Skip to content

Instantly share code, notes, and snippets.

@wf9a5m75
Last active August 29, 2015 13:59
Show Gist options
  • Save wf9a5m75/10995158 to your computer and use it in GitHub Desktop.
Save wf9a5m75/10995158 to your computer and use it in GitHub Desktop.
Example : MAP_CLOSE event (phonegap-goolgemaps-plugin)
<!DOCTYPE html>
<html>
<head>
<script src="cordova.js"></script>
<script src="map_close.js"></script>
</head>
<body>
<button id="button">Show the map dialog</button>
</body>
</html>
document.addEventListener('deviceready', function() {
// reate a map instance
var map = plugin.google.maps.Map.getMap();
// Waiting for the MAP_READY event
map.addEventListener(plugin.google.maps.event.MAP_READY, onMapInit);
}, false);
function onMapInit(map) {
// Show the map dialog when the button is clicked.
var button = document.getElementById("button");
button.addEventListener("click", function() {
map.showDialog();
}, false);
// The MAP_CLOSE event will be fired when the map dialog is closed.
map.addEventListener(plugin.google.maps.event.MAP_CLOSE, function() {
alert("The map dialog is closed");
});
}
@wf9a5m75
Copy link
Author

img

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment