cancel
Showing results for 
Search instead for 
Did you mean: 

Google Map API (with Key) configuration in sap.ui.vbm.GeoMap?

ankurbabu1
Explorer
0 Kudos
398

I am trying to use Google Maps (with API key) as map provider in sap.ui.vbm.GeoMap, but the maps are not being displayed. My API key is correct (checked with Google maps extension). This is how I am using it in mapconfig:

var oMap = new sap.ui.vbm.GeoMap();
var oMapConfig = { 
           “MapProvider”: [{
                    “Id”: “GM”,
                    “name”: “Google Maps”,
                    “minLOD”: “1”,
                    “maxLOD”: “19”,
                    “tileX”: “256”,
                    “tileY”: “256”,
                    “copyright”: “© Google Maps”,
                    “Source”: [{
                      “id”: “a”,
                      “url”: “https://maps.googleapis.com/maps/api/js?key=My_API_Key”
                    }]
                }],
                “MapLayerStacks”: [{
                    “name”: “Default”,
                    “MapLayer”: [{
                        “name”: “Default”,
                        “refMapProvider”: “Google Maps”,
                        “opacity”: “1.0",
                        “colBkgnd”: “RGB(255,255,255)”
                    }]
                }]
            }; 


oMap.setMapConfiguration(oMapConfig); 
oMap.setRefMapLayerStack("Default");

Can someone help me with this, what I might be doing wrong or need to change? When I use Open Street Map in the same way, it works fine but not with Google Maps

Accepted Solutions (0)

Answers (0)