This class extends BaseClass.
var bounds = [
{"lat": 40.712216, "lng": -74.22655},
{"lat": 40.773941, "lng": -74.12544}
];
var mapDiv = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(mapDiv, {
camera: {
target: bounds
}
});
// Add ground overlay
var groundOverlay = map.addGroundOverlay({
'url': "../images/newark_nj_1922.jpg",
'bounds': bounds,
'opacity': 0.5
});In order to listen the GROUND_OVERLAY_CLICK event, you need to specify the clickable option.
You can get the latitude/longitude pair of clicked position.
var bounds = [
{"lat": 40.712216, "lng": -74.22655},
{"lat": 40.773941, "lng": -74.12544}
];
// Add ground overlay
var groundOverlay = map.addGroundOverlay({
'url': "../images/newark_nj_1922.jpg",
'bounds': bounds,
'opacity': 0.5,
'clickable': true // default = false
});
// Catch the GROUND_OVERLAY_CLICK event
groundOverlay.on(plugin.google.maps.event.GROUND_OVERLAY_CLICK, function (latLng) {
...
});| map.addGroundOverlay() | Add a ground overlay. |
|---|
| setBounds() | Change the bounds of the GroundOverlay. |
|---|---|
| getBounds() | Return the current center position. |
| setBearing() | Change the bearing of the ground overlay. |
| getBearing() | Return the current bearing value. |
| setImage() | Change the image of the ground overlay |
| setOpacity() | Change the opacity of the ground overlay |
| getOpacity() | Return the current opacity. |
| setClickable() | Change click-ability of the ground overlay. |
| getClickable() | Return true if the ground overlay is clickable. |
| setVisible() | Change visibility of the ground overlay. |
| getVisible() | Return true if the ground overlay is visible. |
| setZIndex() | Change the ground overlay zIndex order. |
| getZIndex() | Return the current ground overlay zIndex. |
| remove() | Remove the ground overlay. |
| GROUND_OVERLAY_CLICK | Arguments: LatLng This event is fired when you click on a ground overlay. |
|---|

