Bing has a 2 eventStyles for a pushpin.
- enableHoverStyle : Boolean
- enableClickedStyle : Boolean
go to link below to see these events/styles in action http://www.bing.com/api/maps/sdk/mapcontrol/isdk#setPushpinOptions+JS
So what im trying to accomplish is deselected a already selected pin when another pin is selected. Is there a way to do that?
Edited:
I have found a solution not sure if it is optimal but here it is.
I had the event trigger on pushpin click
Microsoft.Maps.Events.addHandler(pushpin, 'click', togglePinState);
Then, the togglePinState function
function togglePinState(pinData){
if(pinData.target == null)
return;
if(selectedPin == null){
selectedPin = pinData.target;
selectedPin.setOptions({enableClickedStyle: true});
return;
}
if(pinData.target != selectedPin){
selectedPin.setOptions({enableClickedStyle: false});
selectedPin = pinData.target;
selectedPin.setOptions({enableClickedStyle: true});
}
}