Forge Component
(20)
Published on 7 Feb (3 weeks ago) by Labs
20 votes
Published on 7 Feb (3 weeks ago) by Labs

Hi.

I'm using OS10 with google maps mobile. I have two markers on the map and my original goal is to click onone of them and navigate to a different screen and send the id. 

I have tried to set the destination of the event raised to a screen but nothing happens when I click on the icon.

So now I'm trying to have a infowindow with a link to the screen appear when I click the marker.

The MapMakerEvents.Event is id from the events static entity.


Is there anything I'm doing wrong?


Thank you for your help in advance.


I'm not sure if this is your problem, but it appears as though you may not have the MarkerEventsList properly set.  In the OnInitialize or OnReady, you should do something like this:

What this list does is sets all the event listeners for you, so you don't have to do them in Javascript (like the marker.addeventlistener that you have above).  Those listeners will be set before, then the MarkerRaisedEvent action will fire when they are executed.  Hopefully this helps.  Let me know if I'm totally off base.

Mike Neyman wrote:

I'm not sure if this is your problem, but it appears as though you may not have the MarkerEventsList properly set.  In the OnInitialize or OnReady, you should do something like this:

What this list does is sets all the event listeners for you, so you don't have to do them in Javascript (like the marker.addeventlistener that you have above).  Those listeners will be set before, then the MarkerRaisedEvent action will fire when they are executed.  Hopefully this helps.  Let me know if I'm totally off base.

Thank you for your reply... That's not the issue unfortunatly, eventhough it's not shown in the pictures above I have something similar to that on the OnInitialize. The "getEvent" gets the "click" event.


In fact, I have been doing a bit more researching and trying different things (right now I'm keeping things simple with the onclick changing to another screen) and something really weird happens. If I debug on chrome it works perfectly; if I use the chrome emulator it works sometimes and mostly on double or triple click; on my phone it never works (not even on debuging). This makes no sense to me.


Hi Erica,


Can you share your .oml or isolate the behavior on a new module so we can take a look?

Cheers

Henrique Batista wrote:

Hi Erica,


Can you share your .oml or isolate the behavior on a new module so we can take a look?

Cheers

Hi!


I tried my best to isolate everything I use for the maps. 


Thank you in advance.

I forgot to mentioned that the maps is in a Tab. I tested it outside the tab and it works.

Any way to make it work inside the tab?

I do notice that you are trying to keep things fairly simple, but I would suggest simplifying even further (i.e. adding the click event directly as opposed to through a wrapper, creating the info window object directly as opposed to in a wrapper.  I don't see anything glaring that stands out, especially noticing you corrected a few of the items like setting the event listener in the "MapMarkerRaisedEvent" action that I noticed in your original post.  It is puzzling that it works in Chrome and not in the debugger, and I'm assuming the MapMarkerRaisedEvent action does not even fire in the debugger for the click event?

Mike Neyman wrote:

I do notice that you are trying to keep things fairly simple, but I would suggest simplifying even further (i.e. adding the click event directly as opposed to through a wrapper, creating the info window object directly as opposed to in a wrapper.  I don't see anything glaring that stands out, especially noticing you corrected a few of the items like setting the event listener in the "MapMarkerRaisedEvent" action that I noticed in your original post.  It is puzzling that it works in Chrome and not in the debugger, and I'm assuming the MapMarkerRaisedEvent action does not even fire in the debugger for the click event?

When I try to use it on the phone or when I'm debugging directly on the phone, it doesn't trigger anything.

Only when debugging on chrome it triggers. 


Solution

Google maps was inside a widget and didn't work correctly that way. Without the widget it works fine.

Solution