Opened 19 years ago

Last modified 15 years ago

#1290 new enhancement

scalebar minscale/maxscale enhancement

Reported by: woodbri@… Owned by: sdlime
Priority: low Milestone: 6.0 release
Component: MapServer C Library Version: unspecified
Severity: minor Keywords:
Cc: woodbri@…, mapserver@…

Description (last modified by sdlime)

I would like to see MINSCALE/MAXSCALE parameters added to the SCALEBAR object in
the mapfile, so it is possible to define SCALEBARs that can change the UNITs as
the user zooms in and out.

It makes more sense to have scalebar in MILES when you are view things at large
scales and FEET when you are zoomed in to street level.

Attachments (2)

mapserverDualScaleBar1.png (89.4 KB ) - added by jnovak@… 18 years ago.
Dual scalebars in tick style
mapserverDualScaleBar2.png (87.5 KB ) - added by jnovak@… 18 years ago.
Dual scalebars in filled style

Download all attachments as: .zip

Change History (10)

comment:1 by mapserver@…, 19 years ago

Cc: mapserver@… added

comment:2 by sdlime, 19 years ago

I'll consider (not a bad idea) it but this is probably a ways off from 
implementation given other priorities. There is a work around though you could 
employ using the CGI or MapScript. With just a bit of javascript and 
mode=scalebar you could change the scalebar units based on scale. Something 
like this could be used in a browse template:

<script language="javascript">
  var scale = [scale];
  var units = "miles"; // default scalebar units

  if(scale < 24000)
    units = "feet";

  document.write("<img src='/cgi-bin/mapserv?mode=scalebar&map=[map]&mapext
[mapext_esc]&map_scalebar_units=" + units + "'>");
</script> 

You may also have to pass the mapsize if the correct value is not being set in 
the mapfile. 

Granted this requires scripting but gets you the scale dependent map units.

Steve

comment:3 by sdlime, 18 years ago

Milestone: 5.0 release

by jnovak@…, 18 years ago

Attachment: mapserverDualScaleBar1.png added

Dual scalebars in tick style

by jnovak@…, 18 years ago

Attachment: mapserverDualScaleBar2.png added

Dual scalebars in filled style

comment:4 by jnovak@…, 18 years ago

attachments.isobsolete: 01

comment:5 by jnovak@…, 18 years ago

attachments.isobsolete: 01

comment:6 by sdlime, 17 years ago

Description: modified (diff)
Milestone: 5.0 release5.2 release
Priority: highlow

John: I don't suppose you still have the patch laying around? Marking for 5.2 on the off chance you do...

Steve

comment:7 by sdlime, 16 years ago

Milestone: 5.2 release5.4 release

Low priority, moving to 5.4 milestone.

Steve

comment:8 by sdlime, 15 years ago

Milestone: 5.4 release6.0 release
Note: See TracTickets for help on using tickets.