publiclab / leaflet-environmental-layers

Collection of different environmental map layers in an easy to use Leaflet library, similar to https://github.com/leaflet-extras/leaflet-providers#leaflet-providers
https://publiclab.github.io/leaflet-environmental-layers/example/
GNU General Public License v3.0
99 stars 77 forks source link

At closer zoom levels in MapKnitter layer, display DistortableImages instead of markers #153

Open jywarren opened 5 years ago

jywarren commented 5 years ago

This will be based on https://github.com/publiclab/Leaflet.DistortableImage/

The code for this layer is at: https://github.com/publiclab/leaflet-environmental-layers/blob/master/src/mapKnitterLayer.js

Any help appreciated!

sagarpreet-chadha commented 5 years ago

@jywarren , I will need to study LDI API for this . If you can provide following details, it would be great help!

map.whenReady(function () {
  // By default, 'img' will be placed centered on the map view specified above
  img = L.distortableImageOverlay('example.png').addTo(map);
});

Does this function will help? If yes, then the image URL is in the mapknitter API (https://mapknitter.org/map/region/Gulf-Coast.json?minlon=-98.8&minlat=23.6&maxlon=-79.1&maxlat=31.8) ? Also what about the position of the image, do we have to mention it?

jywarren commented 5 years ago

Ah so, for each map, we have to make an additional call to find the corner locations of each image. The call is:

https://mapknitter.org/maps/MAPNAME/warpables.json

so for example, https://mapknitter.org/maps/pvdtest/warpables.json -- this shows the URL of each image and the corner positions. These can be used to construct the LDI object. Then we can just delete it when you zoom out again. How does that sound?

On Sat, Aug 24, 2019 at 7:32 AM Sagarpreet Chadha notifications@github.com wrote:

@jywarren https://github.com/jywarren , I will need to study LDI API for this . If you can provide following details, it would be great help!

  • So at zoom level lets say 15, we will replace marker with LDI image if it exists,right?

map.whenReady(function () { // By default, 'img' will be placed centered on the map view specified above img = L.distortableImageOverlay('example.png').addTo(map); });

Does this function will help? If yes, then the image URL is in the mapknitter API ( https://mapknitter.org/map/region/Gulf-Coast.json?minlon=-98.8&minlat=23.6&maxlon=-79.1&maxlat=31.8) ? Also what about the position of the image, do we have to mention it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/leaflet-environmental-layers/issues/153?email_source=notifications&email_token=AAAF6J2GU5EV2JDELDLLL7TQGELZHA5CNFSM4HA4CV52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5B6I4Y#issuecomment-524543091, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAF6J6ZQAHBCUVLMUCEFZ3QGELZHANCNFSM4HA4CV5Q .

stefanosu commented 4 years ago

Is there any help that is wanted on this issue if so I can be of assistance.

jywarren commented 4 years ago

Hi, that would be great -- we're trying to get it so that when zooming in far enough, you see something like this:

image

Instead of like this:

image