Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to change the QGIS Web Client measure tool (distance and area) so that it shows feet or miles rather than meters?

share|improve this question
up vote 2 down vote accepted

you have to change some code in qgis-web-client / site / js / WebgisInit.js you can add unit parameter to OpenLayers.Control.Measure method. you have to do this for polygon too...

measureControls = {
    line: new OpenLayers.Control.Measure(
      OpenLayers.Handler.Path, {
        persist: true,
        units:'ft',
        handlerOptions: {
          layerOptions: {styleMap: styleMapMeasureControls}
        }
      }
    )

other units are ‘degrees’ (or ‘dd’), ‘m’, ‘ft’, ‘km’, ‘mi’, ‘inches’..

i hope it helps you....

share|improve this answer
    
Thanks for the quick reply. Unfortunately this doesn't work for me under Linux Mint 12. I even went so far as to download the latest QGIS Web Client code and re-configure. The measure distance tool still shows units in meters and kilometers rather than feet and miles. In a perfect world, QGIS Web Client would use the same units as the coordinate system. Or at least it should be configurable inside GlobalOptions.js. BTW, I changed the units from 'degrees' to 'ft' inside GlobalOptions.js and still no go. Any other suggestions? – Rayner May 18 '12 at 19:18

I had this same problem. You'd think just changing the units would do it but it doesn't. You need to set the 'displaySystem' option to switch to "American Metric/SAE", aka 'english'.

    measureControls = {
        line: new OpenLayers.Control.Measure(
        OpenLayers.Handler.Path, {
            persist: true,
            units:'ft',
            displaySystem: 'english',
            handlerOptions: {
                layerOptions: {
                    styleMap: styleMapMeasureControls
                }
            }
        }),
        polygon: new OpenLayers.Control.Measure(
        OpenLayers.Handler.Polygon, {
            persist: true,
            units:'ft',
            displaySystem: 'english',
            handlerOptions: {
                layerOptions: {
                    styleMap: styleMapMeasureControls
                }
            }
        })
    }; 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.