Giter Club home page Giter Club logo

Comments (1)

Raruto avatar Raruto commented on May 27, 2024

Hi @luisfio1,

this is issue somehow related to: #273 (comment)


In your example loading a local GPX.file the way points are apparently not supported.

This is the message that appears in the console:

"control.js:328 Unsopperted GeoJSON feature geometry type:Point"

Is there any option to include them?

that example make use of the addData() function which is a bit lower level in the execution flow than the load() function:

onEachFeature: function(d, layer) {
controlElevation.addData(d, layer);
},

case 'Point':
default: return console.warn('Unsopperted GeoJSON feature geometry type:' + geom.type);

I have tried to add the points with the options:

waypoints: true,
wptLabels: true,

but it doesn't seem to accept them.

That's where they are currently in use:

pointToLayer: (feature, latlng) => {
if (waypoints) {
let { desc, name, sym } = feature.properties;
desc = desc || '';
name = name || '';
// Handle chart waypoints (dots)
if ([true, 'dots'].includes(waypoints)) {
this._registerCheckPoint({
latlng: latlng,
label : ([true, 'dots'].includes(wptLabels) ? name : '')
});
}
// Handle map waypoints (markers)
if ([true, 'markers'].includes(waypoints) && wptIcons != false) {
return this._registerMarker({
latlng : latlng,
sym : (sym ?? name).replace(' ', '-').replace('"', '').replace("'", '').toLowerCase(),
content: [true, 'markers'].includes(wptLabels) && (name || desc) && decodeURI("<b>" + name + "</b>" + (desc.length > 0 ? '<br>' + desc : ''))
});
}
}
},

For your convenience, I recommend that you take some functions such as _loadLayer() as a reference and alter them to your liking (it is nothing more than utility function for build a standard L.GeoJSON object).

Then (within the example) you can insert your customization from here 👇

onEachFeature: function(d, layer) {
controlElevation.addData(d, layer);
},

Or at least I'd start experimenting from there..

👋 Raruto

from leaflet-elevation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.