I'm trying to display several markers on a map without using Views. I've looked through the examples provided with openlayers module and i found Geojson data for Layers might be what i need. I've looked Example GeoJSON, "Picture This" but when i used my file with geojson data in the "URL" field instead of pasting the data in "GeoJson data" field. I only get the last element.

My GeoJson data follow the geojson specs

Here's what kind of data i have in the file (about 150 point in total) :

{ "type": "FeatureCollection", "features": [{ "type": "Feature",
      "geometry": {"type": "Point", "coordinates": [2.12486743927,50.1950752099]},
      "properties": {
        "name": "garden1",
        "description": "description for garden1",
        "views": "6544",
        "date": "1970-01-01T00:00:00.000Z",
        "pl": "11",
        "vid": "cX4vR9a2X-U",
        "thumb": "http://i1.ytimg.com/vi/cX4vR9a2X-U/0.jpg",
        "duration": "01 min 14 s"
        }
      },{ "type": "Feature",
      "geometry": {"type": "Point", "coordinates": [1.71256363392,49.8922377856]},
      "properties": {
        "name": "garden2",
        "description": "description for garden2",
        "views": "3762",
        "date": "1970-01-01T00:00:00.000Z",
        "pl": "11",
        "vid": "8g93_17C-KE",
        "thumb": "http://i1.ytimg.com/vi/8g93_17C-KE/0.jpg",
        "duration": "01 min 15 s"
        }
      }
]}

see attachment youtube_geojson.txt (to be renamed youtube_geojson.geojson)

The problems are :
- i always only get the last element : here "garden2" displayed on the map.
- the position is wrong : the point is placed at about 0,0

So, is it a bug ? Is this the wrong format i use for the file ? I would like to provide a file with points ( > 150) and also afile with polyline geometry. Is that possible with that geoJson format in openlayers plugin ?
Thank you

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dolivier’s picture

Status: Active » Fixed

I found out that the problems were solved by changing the default Projection set when adding a new Layer : EPSG:3857. It has to be EPSG:4326, and then everything is ok, for my GPS coordinates display.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.