[OpenLayers-Dev] Formatting degrees in MousePosition

Erik Uzureau euzuro at gmail.com
Mon Jan 29 12:14:28 EST 2007


This can easily be made an option. If someone wants to make a ticket
and file this
code as a patch, we can look at integrating it into the codebase.

We are going to need an ICLA from you, though, Lance.

Can you put your name on here and send it to psc at openlayers.org?
http://www.openlayers.org/icla.txt

Thanks
Erik


On 1/29/07, Jeff Dege <jdege at korterra.com> wrote:
> I think that offering an option of displaying degrees in minutes and
> seconds, instead of decimal fraction, is a useful addition.
>
> But I don't think it's reasonable to assume that anyone who is using
> degree coordinates wants to display minutes and seconds.  Some of us
> want to display lon/lat in decimal degrees.
>
> > -----Original Message-----
> > From: dev-bounces at openlayers.org
> > [mailto:dev-bounces at openlayers.org] On Behalf Of Lance Dyas
> > Sent: Monday, January 29, 2007 8:30 AM
> > To: dev at openlayers.org
> > Subject: [OpenLayers-Dev] Formatting degrees in MousePosition
> >
> > Fairly simple code... makes it more glossy/finished seeming.
> >
> >
> > formatCoords: function (base) {
> >             var t, t2;
> >            var degrees = Math.floor(base);
> >             var minutes = Math.floor(t = ( base - degrees ) * 60);
> >            var seconds = Math.floor(t2 = ( t - minutes ) * 6000);
> >             seconds = seconds / 100.00;
> >             return ("" + degrees + "\u00B0 " + minutes + "\u0027 " +
> > seconds + "\u0022" );
> >
> > AND
> >
> >     if (this.map.units == "degrees") {
> >           newHtml =  this.formatCoords(lonLat.lon)  +
> > this.separator +
> > this.formatCoords(lonLat.lat);
> >         }
> >     else {
> >          var digits = parseInt(this.numdigits);
> >              newHtml =
> >             this.prefix +
> >             lonLat.lon.toFixed(digits) +
> >             this.separator +
> >             lonLat.lat.toFixed(digits) +
> >             this.suffix;
> >         }
> > _______________________________________________
> > Dev mailing list
> > Dev at openlayers.org
> > http://openlayers.org/mailman/listinfo/dev
> >
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list