Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

109
Vistas
Bing Maps V8 JS API GroundOverlay beneathLabels mouse events

I use a transparent png as groundoverlay covering the whole map.I must set beneathLabels=false because the label-layer of the map makes some parts of my overlay unreadable. But with beneathLabels=false all the mouse/keyboard events goes to my groundoverlay not to the map anymore. I know thi sis documented but I don't want that, how can I route that events to the map? In the google-api I simple declare the groundoverlay as non-clickable. Or ist there any other way than groundoverly to put a transparent png above the whole map without capturing also all events ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I believe to get the mouse events to go through the ground overlay the pointer-events CSS style needs to be set to none. I believe this isn't supported for images in IE10 (min supported browser by Bing Maps when this SDK was released, so likely why this isn't a built-in option). Doing some experimenting, the following seems to work:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script>
    var map, overlay;

    function GetMap() {
        map = new Microsoft.Maps.Map('#myMap', {
            center: new Microsoft.Maps.Location(-16.366, -46.8945),
            zoom: 17
        });

        overlay = new Microsoft.Maps.GroundOverlay({
            bounds: Microsoft.Maps.LocationRect.fromEdges(-16.36523189120857, -46.89686679103114, -16.3674247514764, -46.89337059621697),
            imageUrl: 'https://upload.wikimedia.org/wikipedia/commons/e/e9/Foto_a%C3%A9rea_de_Una%C3%AD_detalhando_o_c%C3%B3rrego_Canabrava_3.jpg',
            rotation: 298,          
            beneathLabels: false
        });
        map.layers.insert(overlay);
        
        //Access the underlying image object and disable pointer events so that mouse events flow through to the map.
        overlay._img.style.pointerEvents = 'none';
    }
    </script>
    <script async defer src="https://bing.com/api/maps/mapcontrol?callback=GetMap&key=[Your Bing Maps Key]"></script>
</head>
<body>
    <div id="myMap" style="position:relative;width:800px;height:600px;"></div>
</body>
</html>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda