cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Geo Map configuration with Google Map API.

Jayakrishnan
Active Participant
0 Kudos

Hi All,

I am working on SAPUI5 Custom Application Development. As per my application scenario i need to integrate Google Map with SAPUI5 Geo Map. When i look for some examples , i mostly see example with HERE Maps. I tried with HERE Maps with App id and App Key , it works fine.

By referring the below post, i tried with Google Map.

var oMapConfig = {
        "MapProvider": [{
            "name": "GMAP",
            "Source": [{
            "id": "s1",
            "url": "https://mt.google.com/vt/x={X}&y={Y}&z={LOD}"
            }]
        }],
        "MapLayerStacks": [{
                "name": "DEFAULT",
                "MapLayer": {
                        "name": "layer1",
                        "refMapProvider": "GMAP",
                        "opacity": "1",
                        "colBkgnd": "RGB(255,255,255)"
                }
        }]
    };

But I did not use any API Key for this Google Map API. But i got an Output, i am able to see the map on the Geo Map Container. Is it a right way of doing it? Does it not required any API Key? Please help me on this.

Thank you,

Regards,

JK.

Accepted Solutions (1)

Accepted Solutions (1)

nabheetscn
Active Contributor
0 Kudos

Let me provide you bit more detail and then you can incorporate. What you are using in Google Map Tiles, read the details here and modify the URL which can include the API key also, for more details read this also.

On a side note there are so many blogs written related to maps in SAPUI5 any reason for using this specific way!

Thanks

Nabheet

Jayakrishnan
Active Participant

Thank you Nabheet for your help.

Answers (2)

Answers (2)

nabheetscn
Active Contributor
0 Kudos

You are using a limited version of maps where you can not do much. In order to use full features and power of google maps use the API something like this. https://maps.googleapis.com/map/api/geocode/json?.......&key="your key"

Jayakrishnan
Active Participant
0 Kudos

Thanks Nabheet for your comments,

I dont know how we can integrate the google maps api with sapui5 geo map. if you look at my code, i dont know where do i put the api key along with the existing URL.

"url": "https://mt.google.com/vt/x={X}&y={Y}&z={LOD}"
nabheetscn
Active Contributor
0 Kudos

Hello

Having a key brings many advantages such as you can track the usage, quotas etc. Read here under API key for more details.

Nabheet

Jayakrishnan
Active Participant
0 Kudos

I am having the key. But i dont know where do i place it on my current code. Please tell.