[OpenLayers-Users] Using Vector Layer with OSM

Christian Hackl hacki at sbox.tugraz.at
Sun Nov 23 17:46:24 EST 2008


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

Thank you so much!


Christian


-- 
Christian Hackl
hacki at sbox.tugraz.at



More information about the Users mailing list