In addition to the DisplayMap function you??™ve seen already, there are two functions here: PanLatLong and PanXY. PanLatLong pans the map to a specific latitude and longitude (as provided in two text boxes) by creating a new VELatLong object. Now we have to create a few HTML input fields in the page and be sure to call the DisplayMap method in the onload event of the tag as shown here:
Pixels X: |  ; Pixels Y:
name="btnPanXY" onclick="PanXY()" />
Lat: | Long:
name="btnPanLatLong" onclick="PanLatLong()" />
CHAPTER 9 ?– AJAX-STYLE MAPPING USING THE VIRTUAL EARTH SDK 221 With this markup, when the PanLatLong button is clicked, the map will pan to the specified coordinates as shown in Figure 9-8.