-
Notifications
You must be signed in to change notification settings - Fork 920
Map.setPadding()
This method allows you to define a visible region on the map, to signal to the map that portions of the map around the edges may be obscured, by setting padding on each of the four edges of the map.
Map functions will be adapted to the padding. For example, the zoom controls, compass, copyright notices and Google logo will be moved to fit inside the defined region, camera movements will be relative to the center of the visible region, etc.
This results in the following changes:
- Camera movements via API calls or button presses (e.g., compass, my location, zoom buttons) will be relative to the padded region.
- map.getCameraPosition() will return the center of the padded region.
- map.getVisibleRegion() will return the padded region.
- UI controls will be offset from the edge of the container by the specified number of pixels.
// top = right = bottom = left = 30px
map.setPadding( 30 )
// top = bottom = 30px
// left = right = 50px
map.setPadding( 30, 50 )
// top = 30px
// left = right = 50px
// bottom = 20px
map.setPadding( 30, 50 , 20 )
// top = 30px
// right = 50px
// bottom = 20px
// left = 10px
map.setPadding( 30, 50 , 20 , 10 )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