adoroszlai / felvidek201410

MIT License
0 stars 0 forks source link

Switch elevation profile #1

Open LucaMoiana opened 10 years ago

LucaMoiana commented 10 years ago

Hi, great code you did here! I noticed You have the elevation profile for a track popping up when the tracks is selected; how did you do? I'm working on this: http://lucamoiana.github.io/maggiore/ And what I'm trying to achieve is to have the elevation profile appear when the track is selected on layer control

thanks

adoroszlai commented 10 years ago

Hi Luca,

Here's the setup:

  1. leaflet-selection.js is a small mixin that allows keeping track of the selected item, a gpx track in this case.
  2. leaflet-distance-marker.js adds km/mile markers along polylines. Their frequency is based on the current zoom level. It depends on leaflet-geometryutil.
  3. leaflet-gpxgroup.js is the workhorse: it loads a set of gpx tracks, adds them to the map, draws them with different colors and lets the user select one of them at a time. The elevation control is created and updated by this object. It depends on the above modules, plus leaflet-elevation and leaflet-gpx.
  4. map.js creates the map, the OSM layer (via leaflet-osm), and the GpxGroup.

That's all. Let me know if you need any specific help (although I'm just a visitor in JS-land).

-Attila

LucaMoiana commented 10 years ago

Thanks Attila for your email. I'm far behind in the learning curve, and I don't get it. I'm adding layers via JSON, creating groups for markers and Polylines and willing to group the elevation profile so I can turn it on and off...but I'm stuck