[OpenLayers-Users] need help with projection issues

Linda Rawson linda.rawson at gmail.com
Mon Jan 14 15:08:56 EST 2008


As far as displaying the mouseposition I added this to that code.


if (this.map.projection = "EPSG:900913") {

var v_lonLat = OpenLayers.Layer.SphericalMercator.inverseMercator(lonLat.lon,
lonLat.lat);

lonLat.lon = v_lonLat.lon;

lonLat.lat = v_lonLat.lat;

v_lonLat = null;

}

var digits = parseInt(this.numdigits);

var newHtml =

this.prefix + " Lon: " +

lonLat.lon.toFixed(digits) +

this.separator + " Lat: " +

lonLat.lat.toFixed(digits) +

this.suffix;
Linda

On Jan 14, 2008 10:22 AM, Christopher Schmidt <crschmidt at metacarta.com>
wrote:

> On Mon, Jan 14, 2008 at 05:35:51PM +0100, O. Baum wrote:
> > I have some polyline data in the format of the geo-coordinates which
> > are used directly in Google Maps (guess they are called "Spherical
> > Mercator"). E.g., a line from (52.50953477032727, 13.38134765625) to
> > (48.850258199721495, 2.35107421875) reaches from Berlin to Paris. Now
> > I want to draw this line on an OpenLayers Vector layer when displaying
> > a Google Maps layer and switched to Spherical Mercator like described
> > in http://trac.openlayers.org/wiki/SphericalMercator.
> >
> > I suppose then this one of your proposals is the correct solution, is
> it?
>
> Yep.
>
> > > If you mean "How can I create features programatically using data in
> > > geographic coordinates", the answer is that you will (in trunk) create
> > > them, then, once your features are created, call
> > > feature.geometry.transform(new OpenLayers.Projection("EPSG:4326"), new
> > > OpenLayers.Projection("EPSG:900913")), before you add your features to
> > > the map.
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>  _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Linda Rawson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080114/46f2282d/attachment.html


More information about the Users mailing list