Raruto / leaflet-elevation

Leaflet plugin that allows to add elevation profiles using d3js
GNU General Public License v3.0
255 stars 85 forks source link

Getting MultiPolygon elevation data #114

Closed sandeepsanwariya closed 3 years ago

sandeepsanwariya commented 3 years ago

not an issue just need help I have a geojson -data https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_ocean.geojson in which I have a polygon of sea now I want to get elevation data of sea polygon

L.geoJSON(ocean , {
  style: {
    color:"",
      fillColor:"#6dd5ff"
  }
} ).addTo(map);

var controlElevation = L.control.elevation(elevation_options).addTo(map);
controlElevation.load(ocean);
console.log(controlElevation)

it shows an error how to solve that I don't know can any one help in this

distance.js:29 Uncaught (in promise) TypeError: Cannot read property 'distanceTo' of undefined

with elevation data with geojson I want to make a layer on the map and want to animate that layer in such a way it shows sea level is increasing with time

Raruto commented 3 years ago

Hello sandeep, your geojson file is a MultiPolygon (which is not supported).

In general it should work with LineString and MultiLineString.

Moreover, in order to display the elevation data first you have to somehow make your file contains this information.

See the following for more info: