Opened 6 years ago

Closed 5 years ago

#1834 closed enhancement (fixed)

Measure tool should provide a unit selection option

Reported by: trevorwekel Owned by: trevorwekel
Priority: low Milestone: 2.4
Component: AJAX Viewer Version: 2.2.0
Severity: trivial Keywords: measure, haspatch
Cc: External ID:

Description

The buffer tool in the Ajax viewer allows the end user to specify the units for the buffer region. The measure tool should do the same. Some users may find measurement by only miles and kilometers too restrictive.

Attachments (2)

measurepatch.patch (15.2 KB) - added by trevorwekel 6 years ago.
Patch for measure tool enhancement
measurepatch2.patch (15.8 KB) - added by trevorwekel 6 years ago.
measure patch with us survey feet

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by trevorwekel

Attachment: measurepatch.patch added

Patch for measure tool enhancement

comment:1 Changed 6 years ago by trevorwekel

See attached patch measurepatch.patch for selecting the measurement units as part of the measure dialog. It was developed against the open source 2.2 branch and should be applicable to trunk.

comment:2 Changed 6 years ago by jng

Keywords: haspatch added

comment:3 Changed 6 years ago by jng

Milestone: 2.4

Changed 6 years ago by trevorwekel

Attachment: measurepatch2.patch added

measure patch with us survey feet

comment:4 Changed 6 years ago by trevorwekel

Martin Morrison suggested that I add us survey feet to the patch. See measurepatch2.patch. I have tested it with .Net. If anyone has a php or java setup running, please try it out and let me know if I broke something (bit busy this week to perform three platform testing).

comment:5 Changed 6 years ago by yangte

Hi Trevor, I have tested your patch on both PHP and JSP, they all worked well. when do you plan put this enhancement to the trunk? another thing is that when you change the "Measure Units" after some points drawn on the map, the total will not be changed. Would you mean to do this?

comment:6 Changed 5 years ago by jng

There is one small bug I've found in measureui.templ

The SetUnits?() function has the unit assignment in the wrong order. The line

units = GetParent().GetMapFrame().IsEnglishUnits()? "km": "mi";

should be the other way round.

units = GetParent().GetMapFrame().IsEnglishUnits()? "mi": "km";

This ensures the default unit selection in the Measure UI lines up with whatever choice was set in the viewer options.

Other than that, the patch looks fine

comment:7 Changed 5 years ago by jng

Resolution: fixed
Status: newclosed

Fixed in 2.4 (r6863, r6864, r6865, r6866, r6867) and trunk (r6868)

Note: See TracTickets for help on using tickets.