javascript - How do I add a class to a pushpin in Bing Maps 7? - Stack Overflow

I have a map with a bunch of pushpins and when a mouse goes over the clickable pushpins I want the curs

I have a map with a bunch of pushpins and when a mouse goes over the clickable pushpins I want the cursor to change to a pointer instead of a hand. I know how to do this with CSS but none of the Pushpin elements appear to have a class defined. Does anyone know how to set the class for the pushpins? Here is what my Javascript looks like right now.

var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(latitude, longitude), { icon: iconUrl, width: size, height: size });
map.entities.push(pushpin);

I have a map with a bunch of pushpins and when a mouse goes over the clickable pushpins I want the cursor to change to a pointer instead of a hand. I know how to do this with CSS but none of the Pushpin elements appear to have a class defined. Does anyone know how to set the class for the pushpins? Here is what my Javascript looks like right now.

var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(latitude, longitude), { icon: iconUrl, width: size, height: size });
map.entities.push(pushpin);
Share Improve this question asked Jul 19, 2011 at 20:38 Paul MendozaPaul Mendoza 5,79812 gold badges56 silver badges85 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

By using the Pushpin option "typeName" you can apply a style like so:

JavaScript:

var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(latitude, longitude), { icon: iconUrl, width: size, height: size , typeName: 'mypin'});<br/>

map.entities.push(pushpin);

CSS:

.mypin { cursor: pointer !important; };

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745333261a4622984.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信