none
pushpin visibile does not work RRS feed

  • Question

  • i can hide a push pin with 

       g.setOptions({
                visible: false
            });

    but it never becomes visible after 

       g.setOptions({
                visible: true
            });

    g is same pin instance.

    Wednesday, March 25, 2020 7:14 PM

All replies

  • Hi Aaron,

    This does not look like Bing Maps Web control code.  Please take a look at setting and getting pin options at https://www.bing.com/api/maps/sdk/mapcontrol/isdk/setpushpinoptions but to remove it from the map you would want to do a RemoveAt or Pop not a set visible to false.

    Sincerely,

    IoTGirl

    Wednesday, March 25, 2020 8:21 PM
    Owner
  • it is bing maps sdk 8 code. visibile is even documented on pin options.

    Thursday, March 26, 2020 4:01 AM
  • Hi Aaron,

    You obviously did not follow the link I suggested so I will bring that code here for you.

    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {});
    var pushpin = new Microsoft.Maps.Pushpin(map.getCenter(), null);
    map.entities.push(pushpin);
    pushpin.setOptions({ enableHoverStyle: true, enableClickedStyle: true });

    Please consider pushing the pin and poping it when you do not want it to show.

    Sincerely,

    IoTGirl

    Thursday, March 26, 2020 5:06 PM
    Owner