question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getmap initialization issue

See original GitHub issue

Greetings, 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:closed
  • Created 9 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DrMoriartycommented, Jan 15, 2016

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

0reactions
alex116commented, Jul 1, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found