[OpenLayers-Users] Using Vector Layer with OSM

Christopher Schmidt crschmidt at metacarta.com
Sun Nov 23 17:59:56 EST 2008


On Sun, Nov 23, 2008 at 11:46:24PM +0100, Christian Hackl wrote:
> Christopher Schmidt ha scritto:
> 
> >On Sun, Nov 23, 2008 at 11:20:56PM +0100, Christian Hackl wrote:
> >>
> >>How does one use a Vector layer upon an OSM base layer?
> >>
> >>[...]
> >>
> >>// the following uses OSM and does *not* work:
> >>   map.addLayer(new OpenLayers.Layer.OSM.Osmarender("Osmarender"));
> >>
> >>   var vectorLayer = new OpenLayers.Layer.Vector("Just a point...");
> >>   var point = new OpenLayers.Geometry.Point(-111.04, 45.68);
> >
> >     point.transform(new OpenLayers.Projection("EPSG:4326"), new
> >     OpenLayers.Projection("EPSG:900913");
> 
> Wow! I can't believe it... My project group and I tinkered with this 
> problem for days, and you post *one* line of code and it instantly works 
> like a charm. Makes me feel quite ignorant :p

Be fair; I also posted one link where you can now find the line of code
in the future :)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list