-
Notifications
You must be signed in to change notification settings - Fork 917
Map.refreshLayout()
Force recalculate the map view location when the map is embedded.
###Description Adjust the embedded map position of the web view.
###Code (with jQuery Mobile)
/**
* jQuery Mobile's panel feature uses CSS transition,
* However this plugin can not detect when CSS transition is started.
*
* For better performance, hide the map before transition,
* then show it again after the transition is finished.
*/
function hideMap() {
map.setVisible(false);
}
function showMap() {
// Map.refreshLayout() changes the map position forcely.
// It causes slow or hang up on iOS,
// so do not use too much.
map.refreshLayout();
map.setVisible(true);
}
$("#menulist").panel({
"beforeclose": hideMap,
"close": showMap,
"beforeopen": hideMap,
"open": showMap
});
If you get an error, feel free to ask me on the official community or the issue list.
New version 2.0-beta2 is available.
The cordova-googlemaps-plugin v2.0 has more faster, more features.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md
New versions will be announced through the official community. Stay tune!
Feel free to ask me on the issues tracker.
Or on the official community is also welcome!
New version 2.0-beta2 is available.
The cordova-googlemaps-plugin v2.0 has more faster, more features.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md