37
Views
13
Comments
Solved
How to remove Maps Pin icon and keep popup always on
Question
Application Type
Mobile

Hello Everyone, I'm trying to remove the default Pin Icon the Maps Component has but I have been unsuccessful. Also, I'm trying to keep the popup info always on without the user clicking the pin. 

Thanks in advance.

2020-03-25 15-04-11
João Ferreira
Staff
Solution

I wasn't capable to replicate the issue, but I was capable to trigger the popup using the search.

I Just changed the ListSort By to something like "Description = TextVar" and I have edit the js function to a simple timeout (some milliseconds since we are rendering the DOM) that pops the Marker[0].

Hope this helps you,
João Ferreira

2020-03-25 15-04-11
João Ferreira
Staff

Hi @Paulo Ribeiro,

I don't know if I understand all the context of your use case. But on OutSystemsMaps component is possible to change the markerIcon or even hide it, and it's possible to open the Popup via JavaScript API (you have to make sure the marker is rendered).

I've built a sample illustrating this, let me know if this helps you.

Best Regards,
João Ferreira


 

Sample_Reactive_RemoveMarker.oml
2025-03-14 15-09-04
Paulo Ribeiro

Hello, this is for Mobile, for some reason I can't replicate the MarkerPopup.Id in the WidgetId Input from the JS script. Any idea why? It only shows up to the list the Marker is in. i figured it's because it's inside of a list, any workaround?

Thanks in advance



2020-03-25 15-04-11
João Ferreira
Staff

Hi @Paulo Ribeiro,

Sorry for the wait, you can get the id using JS, like so "document.querySelectorAll("[data-block='Marker.MarkerPopup']")[index].id".
But we have a limitation on the component, we just allow to display a Popup at a time, so if you have more than one Popup it will just open the last one that you call.

I'll raise this use case to the team, to check if we will add it to our backlog.

Best Regards,
João Ferreira


Sample_Reactive_RemoveMarker2.oml
2025-03-14 15-09-04
Paulo Ribeiro

Hello João,

thank you for your reply, I’m bummed that this has no workaround but glad to be of help of, maybe a future feature!

Update me if you can if this turns into something in the future.

Kind regards,

2025-03-14 15-09-04
Paulo Ribeiro

Hello again João, trying out your 2 Javascript gave me this error

Any idea what it is?

2020-03-25 15-04-11
João Ferreira
Staff

It doesn't seems related with the javascript, It looks like an issue on AdvancedFormat.
But I'm not sure, without more context It's difficult to give an advice.
Can you share an .oml with a sample?

2025-03-14 15-09-04
Paulo Ribeiro
mapteste.oml
2020-03-25 15-04-11
João Ferreira
Staff
Solution

I wasn't capable to replicate the issue, but I was capable to trigger the popup using the search.

I Just changed the ListSort By to something like "Description = TextVar" and I have edit the js function to a simple timeout (some milliseconds since we are rendering the DOM) that pops the Marker[0].

Hope this helps you,
João Ferreira

2025-03-14 15-09-04
Paulo Ribeiro
2020-03-25 15-04-11
João Ferreira
Staff

Hello @Paulo Ribeiro,

Here it is:

setTimeout(function(){

    var MarkerPopupList = document.querySelectorAll("[data-block='Marker.MarkerPopup']")

    MapAPI.MarkerManager.OpenPopup(MarkerPopupList[0].id)

}, 500);

Regards,
João Ferreira

2025-03-14 15-09-04
Paulo Ribeiro

I'm sorry João, but that one is only opening the first entry in the list and not the correct one.

2020-03-25 15-04-11
João Ferreira
Staff

As I said, I've change the ListSort by to "Description = TextVar", and with that the first entry will be the right one

2025-03-14 15-09-04
Paulo Ribeiro

Hello João,

I did as you instructed but it opens the same one every time, even if I search for another one.

I debugged and it returns the correct but the JS doesn't seem to go there.


Kind regards.

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