Skip to content Skip to sidebar Skip to footer

Reading A Geojson File Into Rails/leaflet

I've created GeoJSON file with Rails jBuilder and want to read it in to Leaflt. It's OK if I use it directly like so L.mapbox.featureLayer().loadURL('overview/overview_data.geojson

Solution 1:

Worked this time. Posting a question led me to an answer.

  $.getJSON("overview/overview_data.json", function (data) {

  <allthestuffIneededtoto

   } )

One of the mysteries of JavaScript. Can it be done something like I was trying.

Post a Comment for "Reading A Geojson File Into Rails/leaflet"