Figure 9-8. Example of panning by location (set by latitude/longitude to the Chicago area)
In addition to panning to a particular location, you can pan relative to the current
location by a number of pixels using the PanXY method. It takes two parameters, X and Y,
with which you specify the direction. For X, negative values pan to the left of the map, and
positive values pan to the right. For Y, negative values pan toward the bottom of the map,
and positive ones pan to the top. The PanXY JavaScript function you saw in the preceding
code segment reads the X and Y coordinates from the text boxes on the page and pans the
map accordingly using the Pan method of the VEMap control.
CHAPTER 9 ?– AJAX-STYLE MAPPING USING THE VIRTUAL EARTH SDK 222
Using Pushpins
Maps are all very nice, but without any kind of attribution and labeling, they lose their
usefulness after a while. Fortunately, VE maps support graphical pushpins that allow you
to highlight specific locations on the map. You have already seen pushpins in Figure 9-1
when searching for Barnes and Noble bookstores in the Chicago area.
Pages:
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313