getmap initialization issue
See original GitHub issueGreetings, I have been utilizing the map plugin successfully, and have started playing with options. with getmap()
var mapProp2 = {'backgroundColor': 'white',
'mapType': plugin.google.maps.MapTypeId.ROADMAP,
'controls': {
'compass': true,
'myLocationButton': true,
'indoorPicker': true,
'zoom': true
},
'gestures': {
'scroll': true,
'tilt': true,
'rotate': true
},
//fix for camera on iphone... always zoomed out if this is not set.
'camera': {
'zoom': 15
}};
map = plugin.google.maps.Map.getMap(mapDiv, mapProp2);
The map will not appear and will generate an error 03-07 11:01:53.327: D/CordovaLog(7935): file:///android_asset/www/plugins/plugin.google.maps/www/googlemaps-cdv-plugin.js: Line 115 : ‘getMap’ is not defined in GoogleMaps plugin.
If I remove the ‘camera’ : { ‘zoom’: 15} option, then the map will appear, which is easy enough, however I would like to know if I’m doing something wrong.
Am I allowed to initialize the camera in the getMap() or do I have to do that after the MAP_READY has fired?
Issue Analytics
- State:
- Created 9 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
GetMap fails with panic, regardless of err given in return ...
When client returns error some of the services are not initialized and they might be nil which means that calling other methods can...
Read more >mapFragment.getMap () is null when the user do a device ...
I have solved my issue with a new class created RetainMapFragment: import android.os.Bundle; import com.google.android.gms.maps.MapFragment; public class ...
Read more >Objects placed in DistributedMap are not replicated - IBM
Another way to initialize a DistributedMap is to call: com.ibm.wsspi.cache.DistributedObjectCacheFactory.getMap(String) com.ibm.wsspi.cache.
Read more >Default values in a Map in C++ STL - GeeksforGeeks
To initialize the map with a random default value below is the approach: Approach: Declare a structure(say struct node) with a default value....
Read more >Documentation - Apache ECharts
You shall not initialize multiple ECharts instances on a single container. ... v5.3.0 getMap has to be used after the MapChart or GeoComponent...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The bug still exists:
plugin.google.maps.Map.getMap(document.getElementById('map_canvas'))
'getMap' is not defined in GoogleMaps plugin. console-via-logger.js:173
plugin.google.maps 1.3.9 “phonegap-googlemaps-plugin” bash-3.2$ ionic --version 1.7.11 bash-3.2$ cordova --version 5.4.1 Android 4.4.2
Would someone please update this tutorial example? https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Map.getMap()#create-a-map-with-initialize-options
It seems to initialize getMap() with the options and is missing the DOM element just like what is seen in this comment above by bradmarder.