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: 
Reply
Message 1 of 2
laikuan
87 Views, 1 Reply

zoomSelected

Hi,

I have converted all the datasets into Oracle Spatial Enterprise Endition R9.2.0.1.0. I make a query to the line feature, fg. street or fibre cable. The correspondent layer is set to SRID 8307 and the coordinate system for the map file is LL84.

When i click on one of the record from the list of the result, the system do not zoom in and highlight the selected feature. The layer is visible in all scale.

Here is the code:
function zoomToFeat(feaKey,layerName)
{
var map = getMap();
var zoomScale = map.getScale()/1500;
alert("Feature Key: " + feaKey);

var fealayer = map.getMapLayer(layerName);
var mapobj = fealayer.getMapObject(feaKey);
alert("mapobj: " + mapobj);

map.setAutoRefresh(false);
map.getSelection().clear();
map.getSelection().addObject(mapobj,false);

map.zoomSelected();
map.setWidth(500,"M");
map.setAutoRefresh(true);
map.Refresh();

return;

}
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: laikuan

Hi laihuan

You shoul try like this
You should check for if(!map.isBusy())
The map.zoomSelected(); wont work if map is busy
Read Autodesk doc concerning that command.
Check below for the syntax

function zoomToFeat(feaKey,layerName)
{
var map = getMap();

if(!map.isBusy())
{
var zoomScale = map.getScale()/1500;
alert("Feature Key: " + feaKey);

var fealayer = map.getMapLayer(layerName);
var mapobj = fealayer.getMapObject(feaKey);
alert("mapobj: " + mapobj);

map.setAutoRefresh(false);
map.getSelection().clear();
map.getSelection().addObject(mapobj,false);

map.zoomSelected();
map.setWidth(500,"M");
map.setAutoRefresh(true);< br>map.Refresh();
}
else
alert("Traitement en cours ... \n\nS.V.P. essayez dans quelques secondes.");
return;
}

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

Post to forums  

Autodesk Design & Make Report