[OpenLayers-Users] GeoJSON layer on top of google

Adorian Ardelean mynature at gmail.com
Sat Jun 28 10:39:19 EDT 2008


Hi,

I am trying to load a GeoJSON file in a layer on top of a google map
(OpenLayers 2.6).

I used for now:
var colfeatures = new OpenLayers.Layer.GML("specimens", "geojson.php",
{format: OpenLayers.Format.GeoJSON});
map.addLayer(colfeatures);

Entities show up on the map somewhere close to 0,0. For other vector
entities (coordinates) I push through code this is solved with

var g = new OpenLayers.Projection("EPSG:4326");
var p = new OpenLayers.Projection("EPSG:900913");

and .tranform(g,p)

but I do not know how to apply this directly on features read from GeoJSON.
Is there a way to loop through all entities in colfeatures and apply
transform(g.p) or can somebody suggest me a better approach?

All the best,
Adorian

http://mybiosis.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080628/2d857948/attachment.html


More information about the Users mailing list