95
Views
5
Comments
Solved
[OutSystems Maps] null is not an object (evaluating script.src)
outsystems-maps
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

I have a mobile application with both Google Maps Library component and Outsystems maps (in different screens). However when I switch screens, sometimes not directly (ie via a screen without any maps) I get this feedback message error on load:
"null is not an object (evaluating script.src)" 
and the map does not load.

After some testing I realised this happens because of the 2 maps components on the same application.

Any ideas what I can do except migrate to the same map component? The reason we have 2 is part legacy but also when we last tested OutSystems Maps it did not work well with the amount of data we were processing and the map was slow or not responsive (hence why we use the 2 components).

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hi @André Pinho 

After a couple of tests, I was not able to find a good workaround for your scenario.
You're using two different implementations of the same library on a SPA so some object instances are trying to access their source code that after the transition to the other screen no longer matches its implementation - this happens mostly on the Google Maps Library component.
Unless you find a way to manipulate the sources and isolate each instance I think you'll always have issues since these two components have the same purpose and shouldn't be used on the same application. So, using only one of the components should be the way the go.

Cheers,
GM


2022-11-12 11-28-30
Gonçalo Martins
Staff

Hello @André Pinho 

Can you share a sample oml with that use case? And share your findings. 
Probably you're facing some incompatibility between the two components since probably they use common libraries, maybe in different versions, which may lead to this kind of issue.
Migrating would probably solve but if it is not an option you need to find the root cause to find a possible workaround and if you share it I can try to take a look.

Cheers,
GM

2018-08-04 18-19-00
André Pinho

Findings:

  • Happens in both mobile and reactive
  • Happens sometimes even when you click go via an intermediate screen without any maps.
  • Maps on the same screen with ifs (hiding one or the other) are affected as well 

    See attached OML. Thanks GM

    If it helps happy to set up a meeting 1:1 to show you some of the challenges we had with the Outsystems Map component. 
MapsError.oml
2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hi @André Pinho 

After a couple of tests, I was not able to find a good workaround for your scenario.
You're using two different implementations of the same library on a SPA so some object instances are trying to access their source code that after the transition to the other screen no longer matches its implementation - this happens mostly on the Google Maps Library component.
Unless you find a way to manipulate the sources and isolate each instance I think you'll always have issues since these two components have the same purpose and shouldn't be used on the same application. So, using only one of the components should be the way the go.

Cheers,
GM


2018-08-04 18-19-00
André Pinho

@Goncalo Martins did I see a fix on the latest OutSystems Maps release to solve this issue? 

ROU-4370 - Fixed an issue that caused the Map_Initialized event not to run after the first time a Map was created.
This occurred when leaving a screen with a Map block (Google Maps) and returning to it afterwards.

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi @André Pinho,

The issue that was fixed on this latest version (1.6.6) was related to the Map's block lifecycle and not taking into consideration other components like the one mentioned in this thread.
So, as I mentioned previously, given the fact you're using two different implementations of the same library on a SPA, unless you find a way to manipulate the sources and isolate each instance I think you'll always have issues since these two components have the same purpose and shouldn't be used on the same application. 
So, using only one of the components should be the way the go since this is not an issue on OutSystems Maps.

Cheers,
GM

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