I am trying to use Google Maps (with API key) as a map provider in sap.ui.vbm.GeoMap library in SAPUI5, but the maps are not being displayed. My API key is correct (checked with Google maps extension) and no error in console.
If I change my source URL to “https://mt.google.com/vt/x={X}&y={Y}&z={LOD}“, the map is being displayed, but I am not sure if this can be used for a production environment as this doesn’t have an API key. 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