on 11-28-2018 6:18 AM
Hi All,
I am working on Custom SAPUI5 Application Development. In my application i need to show the areas in Geo-Map.I used Google API inside the Geo Map as a Visual Business Map Provider. But when i run the application it is not giving the same map layout as Google Maps. Please see the below images for your info.
1. Map Display on my Application:
2. Original Google Map View:
When i search for something on google map it displays with nearby area information too. i want to replicate same kind of view in my application.
This is my code.
var oMapConfig = {
"MapProvider": [{
"name": "GMAP",
"Source": [{
"id": "s1",
"url": "https://mt.google.com/vt/lyrs=s&x={X}&y={Y}&z={LOD}"
}]
}],
"MapLayerStacks": [{
"name": "DEFAULT",
"MapLayer": {
"name": "layer1",
"refMapProvider": "GMAP",
"opacity": "1",
"colBkgnd": "RGB(255,255,255)"
}
}]
};
oGeoMap.setMapConfiguration(oMapConfig);
oGeoMap.setRefMapLayerStack("DEFAULT");
Is it because of any license issue?
Please help me on this .
Thank you,
Regards,
JK.
Hey All,
I found the solution for this. It just a URL change.
New Code:
var oMapConfig = {
"MapProvider": [{
"name": "GMAP",
"Source": [{
"id": "s1",
"url": "https://mt.google.com/vt/lyrs=m&x={X}&y={Y}&z={LOD}"
}]
}],
"MapLayerStacks": [{
"name": "DEFAULT",
"MapLayer": {
"name": "layer1",
"refMapProvider": "GMAP",
"opacity": "1",
"colBkgnd": "RGB(255,255,255)"
}
}]
};
oGeoMap.setMapConfiguration(oMapConfig);
oGeoMap.setRefMapLayerStack("DEFAULT");
Thnak you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I guess you would need to use a source url like:
https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&avoid=TOLLS&libraries=places&callback=initM...
Where you will need an API KEY. As far as I know, official google maps require it.
The callback initMap would be your method/function which trigger the map initialization
Kind regards,
Jorge
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Jorge,
I got an API key now, but now it shows no VBM is configured error. Please see the below images for more info.
var oGeoMap = this.getView().byId(
"GeoMap");
var oMapConfig = {
"MapProvider": [{
"name": "GMAP",
"Source": [{
"id": "s1",
"url": "https://maps.googleapis.com/maps/api/js?key=MY_OWN_KEY&avoid=TOLLS&libraries=places&callback=initMap"
}]
}],
"MapLayerStacks": [{
"name": "DEFAULT",
"MapLayer": {
"name": "layer1",
"refMapProvider": "GMAP",
"opacity": "1",
"colBkgnd": "RGB(255,255,255)"
}
}]
};
oGeoMap.setMapConfiguration(oMapConfig);
oGeoMap.setRefMapLayerStack("DEFAULT");
Thank you for your help
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.