0

I am working on my first web map using the Leaflet API.

I have a shapefile that was converted to the GeoJSON format (within ESRI's ArcMap software). The Shapefile contains a field attribute named "Link_Ref" which contains a string (web address hyperlink) as a value. However, if there is a Link_Ref with no value (just blank space as the value) as shown in the attribute table in ArcMap, and then I export it to GeoJSON for Leaflet, Leaflet will fail to load and I get a blank white browser screen. I see in the browser console the following error:

No value provided for variable {Link_Ref} 

So, if one value is missing, it seems to keep my web map from loading.

I am trying to clean the data, but unsure how to proceed. Will adding the text "null" to all the empty value fields allow my map to load? A quick test of this failed to work.

Why do I get this error and how to fix it?

  • Can you please provide the code that you're using in the Leaflet map? – Stephen Lead Jan 28 '16 at 1:34
  • I've found a fix since I last posted. Sorry I never updated this answer. Will do that now. – redshift Jan 28 '16 at 11:36
1

I've found a fix for now. I'm using the Mapbox API and it comes with mustache.js baked in. Therefore, when using the L.mapbox.template() function, mustache.js will skip over any blank values and finish rendering the DOM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.