[OpenLayers-Users] Re: Why does OpenLayers.Layer.WMS shows vectors well and OpenLayers.Layer.OSM does not? (Same code)

Eric Lemoine eric.lemoine at camptocamp.com
Wed Apr 25 06:20:39 EDT 2012


On Wed, Apr 25, 2012 at 12:03 PM, alexe100 <imoveisnacionais at gmail.com> wrote:
> using:
>
> projection: "EPSG:4326",
>
> does not work either :-(

You add features manually (calling addFeatures on the vector layer).
Your features' coords should be expressed in EPSG:900913. Example:

var src = new OpenLayers.Projection("EPSG:4326");
var dst = new OpenLayers.Projection("EPSG:900913");
var point = new OpenLayers.Geometry.Point(-111.04, 45.68);
point.transform(src, dst);


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list