Google. |
|
Constants | |
DEFAULTS | {Object} It is not recommended to change the properties set here. |
SuperMap. |
Mixin providing functionality specific to the Google Maps API v3. |
Properties | |
animationEnabled | {Boolean} If set to true, the transition between zoom levels will be animated (if supported by the GMaps API for the device used). |
Functions | |
destroy | Clean up this layer. |
getMapObjectBoundsFromOLBounds | |
getMapObjectLonLatFromLonLat | |
getMapObjectLonLatFromMapObjectPixel | |
getMapObjectPixelFromMapObjectLonLat | |
getMapObjectPixelFromXY | |
getMapObjectZoomFromMapObjectBounds | |
onMapResize | |
setMapObjectCenter | Set the mapObject to the specified center and zoom |
Mixin providing functionality specific to the Google Maps API v3.
To use this layer, you must include the GMaps v3 API in your html.
Because SuperMap needs to control mouse events, it isolates the GMaps mapObject (the DOM elements provided by Google) using the EventPane. However, because the Terms of Use require some of those elements, such as the links to Google’s terms, to be clickable, these elements have to be moved up to SuperMap’ container div. There is however no easy way to identify these, and the logic (see the repositionMapElements function in the source) may need to be changed if Google changes them. These elements are not part of the published API and can be changed at any time, so a given SuperMap release can only guarantee support for the ‘frozen’ Google release at the time of the SuperMap release. See https://developers.google.com
For this reason, it’s recommended that production code specifically loads the current frozen version, for example:
<script src="http://maps.google.com/maps/api/js?v=3.7&sensor=false"></script>
but that development code should use the latest ‘nightly’ version, so that any problems can be dealt with as soon as they arise, and before they affect the production, ‘frozen’, code.
Note, however, that frozen versions are retired as part of Google’s release cycle, and once this happens, you will get the next version, in the example above, 3.8 once 3.7 is retired.
This version supports 3.7.
Note that this layer configures the google.maps.map object with the “disableDefaultUI” option set to true. Using UI controls that the Google Maps API provides is not supported by the SuperMap API.
{Boolean} If set to true, the transition between zoom levels will be animated (if supported by the GMaps API for the device used). Set to false to match the zooming experience of other layer types. Default is true. Note that the GMaps API does not give us control over zoom animation, so if set to false, when zooming, this will make the layer temporarily invisible, wait until GMaps reports the map being idle, and make it visible again. The result will be a blank layer for a few moments while zooming.
getMapObjectBoundsFromOLBounds: function( olBounds )
olBounds | {SuperMap.Bounds} |
{Object} A MapObject Bounds, translated from olBounds Returns null if null value is passed in
onMapResize: function()
getMapObjectBoundsFromOLBounds: function( olBounds )
getMapObjectLonLatFromMapObjectPixel: function( moPixel )
getMapObjectPixelFromMapObjectLonLat: function( moLonLat )
Set the mapObject to the specified center and zoom
setMapObjectCenter: function( center, zoom )
getMapObjectZoomFromMapObjectBounds: function( moBounds )
getMapObjectLonLatFromLonLat: function( lon, lat )
getMapObjectPixelFromXY: function( x, y )
Clean up this layer.
destroy: function()