×

First time here?

You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting!

now that the virtual earth version 5 sdk/control is out and available, some that may want to quickly move to v5 may find some refactoring required.  for me, it was pushpins.  when using v4 of vritual earth, i would normally create a VEPushpin first like this:

var pin = new VEPushpin(
        someId, // unique identifier of the pin 
        latLon, // a VELatLong object
        "images/custompin.png", // custom pin object
        "some title", // title
        "some details", // details
        "pinIcon", // icon style
        "pinTitle", // pin title style
        "pinDetails"); // pin details style
    
map.AddPushpin(pin);

when i changed my app to use the v5 control, that instantly broke.  in v5 the pushpin is elevated to the same level as other shapes (or other shapes are downleveled to the same place, whatever you want to think of it).  now when you want to add a pin with some customization, you will want to create a shape like this:

var shape = new VEShape(
                  VEShapeType.Pushpin, // the type of shape
                  [latLong] // a VELatLong object
                 );

shape.SetCustomIcon(pinIcon); // if you wanted to set a custom icon

shape.SetTitle("<div class=\"pinTitle\">" + title + "</div>");
shape.SetDescription("<div class=\"pinDetails\">" + details + "</div>");

map.AddShape(shape);

as you can see basically it isn't too much work, but essentially everything you add is a "shape" (either a pushpin, polyline, polygon).  the only thing i don't like about the new v5 way of doing things is in the v4 way, you could set the css class of the icon, title, details and it would apply it.  i think that was very simplified and allowed me greater control and separation of my styles from my code.  in v5 i now have to do that within my script.  :-( -- hey VE guys, can we change this?

of course, all this is documented in the updated , but i thought it might find it helpful real quick-like for those who may happen to read this :-)


5/14/2007 6:06 AM | # re: virtual earth: goodbye pushpin, hello shape
Note that in V5, using the new code, you're missing the pushpin icon style.

For this reason, your pushpin icon is not vertically aligned correctly anymore.

You need something like

.iconStyle
{
position:relative;
top:-15px;
}


shape.SetCustomIcon("<div class='iconStyle' > <img src="images/custompin.png"> </div>");
5/14/2007 8:42 AM | # re: virtual earth: goodbye pushpin, hello shape
alexandru: good catch! another reason i wish it was just a parameter rather than me have to do it.
5/14/2007 10:35 PM | # re: virtual earth: goodbye pushpin, hello shape
Another thing I'd like to be able to do in the Microsoft Earth Map control SDK, version 5.0 and I can't, is this:

Once a custom icon pushpin is already added to the map, there is no way to reset that icon to the default ?

The statements below don't work, they don't reset the icon of an existing pushpin.

shape.SetCustomIcon(null);

shape.SetCustomIcon("");
7/19/2007 7:49 AM | # re: virtual earth: goodbye pushpin, hello shape
Slight error in the code...the shape type should be "VEShapeType.Point", rather than "VEShapeType.Pushpin".
7/19/2007 8:10 AM | # re: virtual earth: goodbye pushpin, hello shape
wloescher: actually Pushpin is right, see http://dev.live.com/virtualearth/sdk
10/2/2007 8:20 AM | # re: virtual earth: goodbye pushpin, hello shape
How can I add text in the pushpin in version 5.0 ? Thanks
11/1/2007 3:22 AM | # re: virtual earth: goodbye pushpin, hello shape
Hi Tim,

While I used "CustomIcon" I've found appears to be an issue in IE 6 and Microsoft Virtual Earth. Whilst the custom icon has a transparent edge to it, the transparent part is appearing blue in the map. This issue does not appear to be present in IE 7.
Please help me! Thanks alot.
11/19/2008 11:52 AM | # re: virtual earth:clickable push pins
how can make the push pins clickable.and make it to navigate to a particular url when the push pin is clicked
11/19/2008 12:29 PM | # re: virtual earth: goodbye pushpin, hello shape
kannan: By default Pins are already clickable and they show the balloon with the information you provide. If you want them to immediately have an action upon click you need to override the events: msdn.microsoft.com/en-us/library/bb412496.aspx
Gravatar
3/3/2009 1:28 PM | # re: virtual earth: goodbye pushpin, hello shape
Is there any way to specify an ID for the pushpin?
I've been looking through the SDK and it looks like you get get an ID for it, but not specify an ID for it (though you can w/ the VEPolygon and VEPolyLine shapes).
1/29/2017 8:53 PM | # mobdro
good for cost-free of cost. The mobdro application is mobdro for android likewise from your PC/laptop. The main aim of the ARC nice.

 
Please add 5 and 4 and type the answer here:

DISCLAIMER:

The opinions/content expressed on this blog are provided "ASIS" with no warranties and are my own personal opinions/content (unless otherwise noted) and do not represent my employer's view in any way.