9
Views
2
Comments
Solved
[Google Maps Library] Any way to set Google Map zoom in?
Forge component by Labs
27
Published on 26 Feb 2020
Application Type
Reactive

Hello, I would like to call the SetZoom action but it does not work. It keeps prompting me error [object Object]

I have searched that there were others having the same problem, but I cannot get solution from the threads.

https://www.outsystems.com/forums/discussion/37117/setzoom-not-working-at-all/

Tried this but it still gives me the same error.


My settings are as below:

Google Map object

Calling Google Map Set Zoom action

I guess the MapId should be correct.


Is there any solution to this issue? Or is there other way to have the map zoom in?

Rank: #69494
Solution

Debug more deeply today and found the solution. 

You need to get the "MapContainer" widget Id inside the Map block, instead of getting the Map block Id.

I tried to get the MapContainer widget Id through event trigger and it works.

Rank: #69494

I actually tried to debug a bit by adding some console log.

Result:

Seems that the problem is on getting the map. 

But I suppose my MapId is set correctly? (suggested by this thread: https://www.outsystems.com/forums/discussion/40963/google-maps-mobile-error-using-setzoom-action/)

Rank: #69494
Solution

Debug more deeply today and found the solution. 

You need to get the "MapContainer" widget Id inside the Map block, instead of getting the Map block Id.

I tried to get the MapContainer widget Id through event trigger and it works.