![]() You can change the map style, adjust the zoom level, pan the map to a new location, show and hide the default navigation control, and add your own controls to the map. (zoom out 5 clicks to get latitude/longitude and zoom level)Īfter you have a map on your Web page, you can programmatically change the map. Add a new pushpin to the center of the map. Info = "Longitude:\t" center.Longitude Info = "Latitude:\t" center.Latitude "\n" Info = "Zoom level:\t" map.GetZoomLevel() "\n" Info = "latlong: " map.PixelToLatLong(pixel) This method may return null, depending on the selected view and map style. Info = "contains latlong " pinPoint ": " be.ContainsLatLong(pinPoint) "\n" Check to see if the current view contains the pushpin LatLong. Info = "contains pixel " pinPixel.x ", " pinPixel.y ": " īe.ContainsPixel(pinPixel.x, pinPixel.y, map.GetZoomLevel()) "\n" ![]() Check to see if the current birdseye view contains the pushpin pixel point. Info = "LatLongToPixel: " pixel.x ", " pixel.y "\n" Var pixel = be.LatLongToPixel(map.GetCenter(), map.GetZoomLevel()) Info = "width: " be.GetWidth() "\n" Info = "height: " be.GetHeight() "\n" Info = "orientation: " be.GetOrientation() "\n" Info = "thumbnail: " be.GetThumbnailFilename() "\n" Map.LoadMap(LA, 14, VEMapStyle.Road, false, VEMapMode.Mode2D, true, 1) Map.LoadMap(new VELatLong(47.6, -122.33, 0, VEAltitudeMode.RelativeToGround),ġ0, VEMapStyle.Road, false, VEMapMode.Mode2D, true, 1) Ī complete Web page with all of the elements required to show a map may look like the following. To do this, use the overloaded VEMap.LoadMap Method function as follows to pass in the location, zoom level, map style, whether the map is locked, map mode, whether to show the map mode switch, and how much of a tile buffer to display around the map. You can also specify the location, zoom level, and map style of the map when you first load it. The exceptions, which you must call after creating the new VEMap object but before you call the LoadMap method on that object, are: VEMap.onLoadMap Property VEMap.SetDashboardSize Method Customizing the Map When Loading Note: In most cases you must call the call LoadMap method before you call a VEMap method or attempt to access a VEMap property. Create a new instance of the VEMap Class and call the VEMap.LoadMap Method, as follows. If you use a percentage width and or height in the map DIV, it is the percentage of the parent width or height, respectively.ĥ. For cross-browser compatibility, you should always specify the position attribute (both “absolute” and “relative” are valid values). Note: If you do not specify a width, a default width of 600 pixels is used. You can set these values either inline or by defining the values in a style class and then referencing that class, as follows. The position of the map is set by using the “position”, “top”, and “left” properties. The size of the map is defined by the height and width of the DIV element. In the body of the page, add a DIV element to the page to contain the map. Also in the header section, add a reference to the map control, as follows. Note: Your page must use UTF-8 encoding to draw certain elements of the map.ģ. In the header section of an HTML page, add a META element with the charset attribute set to “utf-8”, as follows. At the top of the HTML page add the following DOCTYPE declaration. Displaying the default map, which includes all of the navigation functionality, consists of the following steps:ġ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |