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

218
Vistas
Bing Maps: Handle right click event separately for map and for pin layer

I am using the Bing Maps library (v8) and I have two different context menu's that I want to pop up, one when they right click on a blank area of the map and another one when they right click on a pin.

Here's my right click initialization code:

let map = new Microsoft.Maps.Map(/*element reference*/, {/*some options*/});

let pinLayer = new Microsoft.Maps.Layer();

Microsoft.Maps.Events.addHandler(pinLayer, 'rightclick', (e: any) => console.log("pin clicked");
map.layers.insert(pinLayer);

Microsoft.Maps.Events.addHandler(map, 'rightclick', (e: any) => console.log("map clicked");

It works just fine when I right click the map, I just get "map clicked"

But when I right click a pin, it says "map clicked" "pin clicked"

Is there a clean way for me to only fire the pin event when a pin is right clicked? (other than resorting to setTimeout)

about 4 years ago · Juan Pablo Isaza
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