[OpenLayers-Dev] Scale control and innerhtml text

Dejung Gewissler dejung.gewissler at oit.state.nj.us
Fri Feb 1 10:22:16 EST 2008

I second that. We could have the string "Scale: " be a property of the 
class that can be overridden.
Currently we've got:
    this.element.innerHTML = "Scale = 1 : " + scale;

If we made the property:
    scaleText: "Scale = 1 : ",
...and then changed the above to:
    this.element.innerHTML = this.scaleText + scale;
problem solved.

On another note (but still related to the Scale control) could we alter 
the way the scale is formatted when it is in the 1:100000+ range.
Currently we've got:
    scale = Math.round(scale / 1000000) + "M";
I propose:
    scale = Math.round((scale / 1000000)*10)/10 + "M";
The reason is that we've got several caches (state plane projection) 
between the million intervals like 2,500,000 and 2,250,000 and 2,000,000 
and 1,500,000 and 1,250,000 etc.
Since they are rounded to the integer we loose a bunch of detail. One 
decimal would be great, two would be even better ... for us :)

Any reasons that would be a bad thing?


Diego Guidi wrote:
> I'm checking the source of the scale control, and i see that the
> innerHTML is something like:
> innerHTML = "Scale: " + number;
> I think that a better behavior is to return only the numeric value, so
> the user could customize the text value (as example using italian
> text).
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev

More information about the Dev mailing list