leaflet-rotate 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,13 +19,29 @@ _For a working example see the following [demo](https://raruto.github.io/leaflet
19
19
  </p>
20
20
  </blockquote>
21
21
 
22
+ ### Build Guide
23
+
24
+ Within your local development environment:
25
+
26
+ ```shell
27
+ git clone git@github.com:Raruto/leaflet-rotate.git
28
+ cd ./leaflet-rotate
29
+
30
+ npm i # install dependencies
31
+ npm run dev # start dev server at: http://localhost:8080
32
+ npm run build # generate "dist" files (once)
33
+ npm run test # test all "*.spec.js" files (once)
34
+ ```
35
+
36
+ After that you can start developing inside the `src` and `test` folders (eg. open "http://localhost:8080/test" in your browser to preview changes).
37
+
22
38
  ---
23
39
 
24
40
  **Side notes:**
25
41
 
26
- Be aware that this is a proof of concept that shows how to alter the core leaflet library and make rotation feature usable as a standalone plugin. Check out fnicollet's [rotate-master](https://github.com/fnicollet/Leaflet/tree/rotate-master) branch if you prefer to use a reliable all-in-one solution.
42
+ Be aware that this library overrides notable parts of leaflet core via the [L.Class.include()](https://leafletjs.com/examples/extending/extending-1-classes.html) function in order to make the rotate feature usable as a standalone plug-in.
27
43
 
28
- Latest changes to this project have been updated comparing on the following: [https://github.com/Leaflet/Leaflet/compare/main...fnicollet:rotate-master](https://github.com/Leaflet/Leaflet/compare/main...fnicollet:rotate-master) (ref: [bac6c7d](https://github.com/fnicollet/Leaflet/tree/4ab6342f74516e7087dcd2ae786c721f36addf9e))
44
+ Initial changes to this project have been apported by comparing the following branches: [https://github.com/Leaflet/Leaflet/compare/main...fnicollet:rotate-master](https://github.com/Leaflet/Leaflet/compare/main...fnicollet:rotate-master) (ref: [bac6c7d](https://github.com/fnicollet/Leaflet/tree/4ab6342f74516e7087dcd2ae786c721f36addf9e))
29
45
 
30
46
  ---
31
47
 
@@ -979,6 +979,10 @@
979
979
  * @returns {L.Map} current map instance
980
980
  */
981
981
  panInside(latlng, options) {
982
+ if (!this._rotate || Math.abs(this._bearing).toFixed(1) < 0.1) {
983
+ return mapProto.panInside.apply(this, arguments);
984
+ }
985
+
982
986
  options = options || {};
983
987
 
984
988
  const paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]),