Google maps setoptions example
The map object has a range of methods and properties that you can use to work with it and there are a range of auxiliary objects which are designed to make it all easier. For example, the map's SetCenter method will move the map location to the specified latitude and longitude. In turn the latitude and longitude are specified as google maps setoptions example suitably initialised LatLng object which we have already used in the first map.
You can adjust all of the other viewing parameters using similar methods and objects — just check the online documentation. For example there is a setOptions and a setZoom method and so on. To try this out google maps setoptions example the button's click event handler google maps setoptions example read:. Moving on from simply panning, zooming and generally controlling the map view it is also possible to add pushpin markers.
This is just a matter of creating a Marker object and customising it using its options object. The options object has a number of possible fields but you have to specify position. The map field specifies the map object that the Marker is added to. This approach allows you to keep a reference to a marker and hence change them after they have been created and add them to the map when you are ready. On the subject of changing Markers - it is worth noting that Markers are fixed by default which means that a user cannot modify your placement by dragging.
You can use a custom graphic for the push pin simply google maps setoptions example setting the setIcon method to a URL that designates the file to be loaded. MarkerImages are more versatile than simple Markers and you can use them to create markers that are have custom hotspots for clicking and location.
You can also draw on the map using Polylines and Polygons and you can google maps setoptions example shapes which are photos and full 3D models. You can also use the AddShape method to add an google maps setoptions example of google maps setoptions example and the DeleteShape method removes shapes.
Shapes can also be organised into layers. Working with the map control is just a matter of figuring out which methods and properties affect the feature you are trying to control. You can do most of the things that a Google Maps user can, including planning a route and finding locations. My advice is to read through the methods and google maps setoptions example of the Map object, which is the central object in the system, and investigate any of the methods and properties that interest you.
Often this will involve finding out how some auxiliary object works that is used as a parameter in the method. In most cases extending Google Maps is a matter of adding shapes, objects and other graphics at various locations. Sometimes you might want to add a more advanced facility and in this case it helps to copy the same approach used by Google i.
You can use this method to control even the parts of the DOM that the map object uses and so change the look of things like markers in code or in CSS. The all work in more or less the same way with the tiny added complication of usually returning data as a JSON object - but this is very easy to work with. Getting started with Google Earth. Getting started wth Bing Maps Virtual Earth.