After I add a few markers is there a way to move the markers based on a new GPS location? Basically I want to bind the map to a datasource and show the markers. But I may add and/or remove markers being returned. When a marker is not returned is it removed from the map? And how are the markers moved? Are they just cleared and moved based on what is in the recordset returned?
Thanks,
Warren
12 Answers, 1 is accepted
The described situation is entirely dependent on how datasource is being changed/modified. Further, teh Map should be only rebound. Although, if you are using RadClientDataSource control for data binding, RadMap should automatically detect changes done to the datasource and rebind the markers.
Therefore, to properly get a proper answer to your question it is best to first define what is the data binding technique used, and how the markers' data would be modified by the client.
Regards,
Ianko
Telerik
![](/forums/images/avatarimages/4d97ea4c-9c31-4129-b7e3-31bbf222863cavatar.png)
That s excellent. Thanks! So if I remove and add markers to the SQL table while using the amp and a datasource those new markers will then show and others will be removed when I rebind the markers?
I will give this a try. Now I just need to look into the popup window for the markers to show information and see if I can add a button to the popup to do something such as view the details of the selected vehicle.
Warren
You can examine in this demo (http://demos.telerik.com/aspnet-ajax/map/examples/data-binding/dataset/defaultcs.aspx) how to add HTML templates as tool tip content, thus, to add HTML button, anchor or whatever you would need.
Regards,
Ianko
Telerik
![](/forums/images/avatarimages/4d97ea4c-9c31-4129-b7e3-31bbf222863cavatar.png)
One question.. I created an aspx page with the map and I set the datasource to show markers from a table and it works great. I then added a timer on the page to rebind every 10 seconds. It displays fine on my pc but when I call the web page on my mobile app and show the web page in a webview control the page flashes when it rebinds. The page actually clears for almost a second while it rebinds. Do you know of any way to rebind without having the page flash like that? Even if I put it inside an ajax update panel won't it do the same?
Thanks,
Warren
![](/forums/images/avatarimages/4d97ea4c-9c31-4129-b7e3-31bbf222863cavatar.png)
To see if it was the web browser control in my mobile app or if it was the website I loaded the web page url into Chrome on my Android phone and it does the same thing. It flashes the whole map away and back when it is rebinding. I am calling databind on the map like this:
RadMap1.DataBind()
I am doing this with a timer control. Is there a better way to do this so the whole page does not flash? The reason I am binding again is the location of the markers will be changing in the sql table and I need to pull them and update the markers on the map.
URL: www.5ttechnology.com/tmap/map104.aspx
Thanks,
Warren
![](/forums/images/avatarimages/4d97ea4c-9c31-4129-b7e3-31bbf222863cavatar.png)
I just restarted the server and the site is coming up fast now.
http://www.5ttechnology.com/tmap/map104.aspx
What do you mean update with AJAX? I am using an ASP.NET timer and calling the DataBind method. I have a sqldatasource on the page that the map is using. How can I rebind with AJAX without the postback or showing it where the browser does a whole refresh and flashes like that?
I can post the code but the web.config has my sql server connection in it. Still post it and remove that? Or I can email it to you and you can try with the connection string.
Thanks,
Warren
![](/forums/images/avatarimages/4d97ea4c-9c31-4129-b7e3-31bbf222863cavatar.png)
Hello Warren,
The map flickering is exactly due to the post back. If you implement logic that updates the RadMap via AJAX-controls (i.e., UpdatePanel, RadAjaxPanel or RadAjaxManager), the map will be updated without reloading the entire page. You can examine this demo—http://demos.telerik.com/aspnet-ajax/ajaxmanager/application-scenarios/ajaxify-timer/defaultcs.aspx.
Regards,
Telerik
![](/forums/images/avatarimages/4d97ea4c-9c31-4129-b7e3-31bbf222863cavatar.png)
I know this is a late reply but yes I used your example and it works nice. The map no longer flickers and the entire page does not reload.
I do have one question. I have the markers being called in the sqldatasource which is assigned to the map. And they do show on the map. So if I want to move a marker I just change the lat/lon in the table that is returning the marker. Is this the best way to do this? The only part I hate on this is the markers flash on each update which I assume is because each one is reset with the databind.
Thanks!
I am somehow confused about the exact situation.
If the the map markers should be updated when the table is changed, what alternative could be available to achieve this task? I am unable to consult you on that because this entirely depends on the application requirements.
Also, if the marker is replaced according to new data from the server, I do not see how marker's flickering or flashing would be prevented as the entire DOM element is placed to a different position.
At all, I am quite confused on what the final results should be and what are your exact concerns on the matter. It is merely difficult to discuss programmatic tasks without sending some examples or code snippets of the troubles you encounter.
Also, when it comes to such tasks, it is best to be handled manually as they should be implemented according to the exact needs and requirements.
Regards,
Ianko
Telerik
![](/forums/images/avatarimages/4d97ea4c-9c31-4129-b7e3-31bbf222863cavatar.png)
I remember when I was trying to use the Google mapping and they had a method to move the markers. Basically when a marker was added it was saved in a collection and rather than just reload the markers you could then work with individual markers in the collection such as moving, removing, etc. So I was hoping that once I added a marker I could just move it. But from looking into this more I assume when the marker locations are binded say every 15 seconds it is going to remove all current markers and add them again with the new location.
Thanks!