I want to Implement the functionality to refresh the map whenever location get updated in the database.

I have written following javascript logic to refresh the map.


SyntaxEditor Code Snippet

"setInterval(function(){
        $('#" + Btn_Refresh.Id + "').trigger('click');
   }, 10000);"


and in Action of Button, I am refreshing the table by using refresh Data widget and the Map by using ajax. I am getting the data after a refresh but I am not able to refresh the map Marker.


I am attaching the image for reference.

Thank you

Hi Gautam sharma,

On the action that is triggered by that timer, remove the correspondet marker and add a new with same information. That helped me to do the same.

Regards,

Marco Arede wrote:

Hi Gautam sharma,

On the action that is triggered by that timer, remove the correspondet marker and add a new with same information. That helped me to do the same.

Regards,

I am doing the same. I have attached the oml file, can you please check where I am doing wrong?

Thank You



Hi Gautam,

Looked into your code and I don't see where you are updating the values on the database.

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Gautam,

Looked into your code and I don't see where you are updating the values on the database.

Regards,

Marcelo

Sorry Marcelo Ferreira, I have uploaded the wrong oml file.I have uploaded the new one. 

Thank you:)


Hi Gautam,

This module has the same problem. You are using this entity PointOfInterest to get all the marks and put them on your map. but you are never changing the points there, because of this the marks on your map will always be the same. you need a function that changes the points on this table accordingly your business rules.

Regards,

Marcelo


Marcelo Ferreira wrote:

Hi Gautam,

This module has the same problem. You are using this entity PointOfInterest to get all the marks and put them on your map. but you are never changing the points there, because of this the marks on your map will always be the same. you need a function that changes the points on this table accordingly your business rules.

Regards,

Marcelo


Thank you Marcelo Ferreira,  My this problem gets solved.

But now I am trying to refresh only the marker on the map instead of the refreshing whole map.

Is there any mechanism to refresh the marker without loading the whole map again?


Hi,

With this component you will not be able to do it like that. You will need to reload the page everytime. To achieve that you would need to build yourself some actions to use the Javascript markers.push or markers.setposition to change the markers on the map.

Regards,

Marcelo



Marcelo Ferreira wrote:

Hi,

With this component you will not be able to do it like that. You will need to reload the page everytime. To achieve that you would need to build yourself some actions to use the Javascript markers.push or markers.setposition to change the markers on the map.

Regards,

Marcelo



Hi, 

I am new to outsystems.

Actually, I am trying to achieve the following functionality:

1) Display the locations on the map after fetching from the database, draw the route with the direction arrow,    and the starting point marker and the endpoint marker should be different.

2) once click on button show route, one marker should move along the drawn path through starting point to end point.

3) one option for live tracking, once click on live tracking the marker should continuously move as soon as location gets updated in the database.

According to the above functionality can you please give me a proper guideline, some component name related to this or some sample code.


Thank you 

Gautam