Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MapGuide map hangs

1 REPLY 1
Reply
Message 1 of 2
Anonymous
250 Views, 1 Reply

MapGuide map hangs

Hi all,

In my web-based vehicle tracking system project, I have a vehicle table whose lat/lon coordinates are updated every a few seconds. I refresh the vehicle layer every 10 seconds via autoRefreshOn() and autosRefreshOff() functions in the advanced samples of MapGuide help. But while the autoRefreshOn() function is open, that is while the vehicle layer is refreshed every 10 seconds, if I navigate the map with panning or zooming, often the map hangs, and the only thing you can do is pressing the escape key (or right click on the map map and click "stop"). My code is as follows:

function onTimeOut() {
autoRefreshOff();
var map = getMap();
if (map != null) {
if (!map.isBusy()) {
var mapLayer = map.getMapLayer("Vehicle");
if (mapLayer != null) {
mapLayer.setRebuild(true);
map.refresh();
}
}
}
autoRefreshOn();
}

Although I check the busy state with !map.isBusy() the problem persists. How to avoid this problem?
1 REPLY 1
Message 2 of 2
estibaliz_yague
in reply to: Anonymous

I also have a vehicle tracking map, and it works.
Here you have some code, hope it works you!!

------------------------------------
when the window is loaded (or when the map is loaded):
[ ... ]
var mSeg = 30000; // reloads every 30 secs.
idReload = setInterval("reloadSpecificLayers()", mSeg);
[ ... ]
------------------------------------
function reloadSpecificLayers(){
if (getMap().isBusy())
return;
else {
getMap().getMapLayer("trackLayer").setRebuild(true);
getMap().refresh();
}}

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report