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).
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
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.
Findings:
@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.
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.