181
Views
2
Comments
Solved
[OutSystems Maps] JavaScript Error "osGoogleMap is not defined"
outsystems-maps
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

the code is working in OutSystems Map v1.0.0 but generates error "osGoogleMap is not defined"


Traced the error and found the problematic code:


Any idea how to fix this?

Regards,

George

2020-08-31 15-57-57
Tiago Miguel Pereira
Staff
Solution

Hello George Qiao,

I'm sorry you have encountered this error. The OutSystems Maps component faced a revamp with Version 1.1.0.

You can use the following code to get your Map Object ->

MapAPI.MapManager.GetMapById($paramaters.MapWidgetId)

In order to get your google map ->

MapAPI.MapManager.GetMapById($paramaters.MapWidgetId).provider


Regarding the logic you are using to create directions, I would like to suggest the following link - Show Directions on a Map. We released a set of client actions (Version 1.2.0) that might be useful when the goal is to create and get metrics about a specific direction (from an origin to a destination and containing waypoints). You can check OutSystems Maps APIs here.

If you need further details or explanations, don't hesitate.

Best regards,

Tiago Pereira

2021-07-21 12-04-07
George.Qiao

Thanks, Tiago. 

I've replaced with the SetDirections client action and configured accordingly. It is now working without any error.

Regards,

George

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.