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: 

Measure Distance Units

5 REPLIES 5
Reply
Message 1 of 6
gbneff
804 Views, 5 Replies

Measure Distance Units

Does anyone know how to make the measure command display results in feet rather than miles?
5 REPLIES 5
Message 2 of 6
bill.dhimitri
in reply to: gbneff

Greg,

I don't see a way to configure this via the UI. But I think you can do it by modifying 2 lines in each of these files installed by the MapGuide Web Extensions:

mapviewerphp/measure.php
mapviewerjava/measure.jsp
mapviewernet/measure.aspx

Bill
Message 3 of 6
gbneff
in reply to: gbneff

Bill,

Thanks for the reply. I am able to change the conversion factor and get the distance displayed in feet. Do you know which file(s) to look at to change the label from "Miles" to "Feet" in the Measure Distace pane?

Thanks,

Greg
Message 4 of 6
bill.dhimitri
in reply to: gbneff

Hi Greg,

I think the label string is in those same files. Try a case-insensitive search for "miles".

Bill
Message 5 of 6
dswilson
in reply to: gbneff

I believe the labels are contained inside the en resource file found under ..\webserverextensions\www\localized\.

The DISTANCEMILES, DISTANCEKILOMETERS etc are where the values come from. However it appears that the measure.php (or jsp or apsx) page is where the strings are referenced and need to be changed. Ideally an enahancement is needed to allow the user to specify the units to measure in rather than have the pages hardcoded based on the viewer settings. Since users may be using data that is for floorplans or small developments they may not be working in kilometers or miles and hence the measure pages don't accomodate this.

Dave
Message 6 of 6
gbneff
in reply to: gbneff

I agree. For my needs I will always want measurements in feet. Miles is far too coarse a measurment.

I made the following two changes to display my measurements in feet:

in the C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\mapviewerphp\measure.php file I changed the conversion factor to convert from meters to feet instead of meters to miles:

$distance *= 3.2808399; //get feet

In the C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\viewerfiles\measureui.templ file I modified showunits function to set the units var to "Feet".

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

Post to forums