Last active
August 29, 2015 13:59
-
-
Save wf9a5m75/10995158 to your computer and use it in GitHub Desktop.
Example : MAP_CLOSE event (phonegap-goolgemaps-plugin)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
}); | |
} |
Author
wf9a5m75
commented
Apr 17, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment