node-red-contrib-jwht-map/worldmap
Richard Wiseman 7ee1204cf1
Update worldmap.js to allow "flying" to new bounds (#225)
* Update worldmap.js to allow "flying" to new bounds

When the bounds command is used, give the option to "fly" (a Leaflet term meaning to animate the change of bounds: zoom out, pan, zoom in) to the new bounds rather than simply repositioning the map.  This is done very simply by providing a "fly" flag that, with a truthy value, calls map.flyToBounds instead of map.fitBounds.

There are 10 other places where map.fitBounds is used, but for my purposes, I only want to "fly" to the new bounds when I explicitly set the bounds through this command.  So perhaps these changes could/should be used in other scenarios too.

* Update worldmap.js to allow flying to bounds

I've changed almost every instance of fitBounds so that, if the "fly" property is true, then it will use flyToBounds instead.

I didn't change the search, where it does fitBounds and then panTo, as it wasn't clear how/whether "fly" could be provided there.

I also fixed a few bugs where it was checking for "fit" being a property, but then didn't check its value!  So you could provide fit:false and it would still be treated as fit:true!
2023-04-11 14:48:50 +01:00
..
css Fix geojson multiline fill mistake 2022-01-12 17:05:44 +00:00
images add to emoji doc - allow actual emoji if required for more modern variations 2019-02-11 22:37:32 +00:00
leaflet Fix split map position in iframe 2022-12-16 18:28:17 +00:00
favicon.ico update favicon, add apache 2016-06-08 22:07:54 +01:00
index3d.html Use a better KML parsing library 2022-11-10 11:08:18 +00:00
index.html Use a better KML parsing library 2022-11-10 11:08:18 +00:00
worldmap.js Update worldmap.js to allow "flying" to new bounds (#225) 2023-04-11 14:48:50 +01:00
worldmaphead.html Fix leader length, add transparent pixels option 2021-11-05 13:02:10 +00:00