The
AddPin function uses the AddPushPin method of the VEMap control and passes in a VELatLong
object, which simply stores a latitude, longitude value pair. After that, the title and the
description of the pin are set using the SetTitle and SetDescription based on values from
the HTML input boxes on the page. So as you can see, all that is needed to create a pushpin
is basically values for latitude and longitude. You can also assign images to the
pushpin by adding the URL of an image. Then, at render time, the specified image will
be placed on the map at the specified location. You can see the preceding code segment
running on Figure 9-9.
CHAPTER 9 ?– AJAX-STYLE MAPPING USING THE VIRTUAL EARTH SDK 223
Figure 9-9. Creating custom pushpins on a map
Summary
In this chapter, you looked at the VE SDK and how you can use it to build your own mapping
applications. You looked at how to create and invoke a map on a page and how you
can set its location using latitude and longitude. You learned how to zoom in and out of a
page programmatically and how to use the object model of the VE control to move the
map pane from place to place.
Pages:
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315