Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bbecquet/Leaflet.RotatedMarker
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: bitctrl/Leaflet.RotatedMarker
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on May 31, 2024

  1. fix: integration of Leaflet

    Falko Schumann committed May 31, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    hurali97 Muhammad Hur Ali
    Copy the full SHA
    3c6d3c3 View commit details
  2. fix: icon anchor should be interpreted as L.Point

    Falko Schumann committed May 31, 2024
    Copy the full SHA
    d01a8b7 View commit details
Showing with 8 additions and 3 deletions.
  1. +6 −2 example.html
  2. +2 −1 leaflet.rotatedMarker.js
8 changes: 6 additions & 2 deletions example.html
Original file line number Diff line number Diff line change
@@ -6,14 +6,18 @@

<title>Leaflet rotated marker example</title>

<link rel="stylesheet" href="https://cdn.leafletjs.com/leaflet/v1.1.0/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""/>
<style>
* { margin: 0; padding: 0; }
html, body { height: 100%; }
#map { width:100%; height:100%; }
</style>

<script src="https://cdn.leafletjs.com/leaflet/v1.1.0/leaflet-src.js"></script>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script>
<script src="leaflet.rotatedMarker.js"></script>
<script>
window.onload = function() {
3 changes: 2 additions & 1 deletion leaflet.rotatedMarker.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,8 @@
var iconOptions = this.options.icon && this.options.icon.options;
var iconAnchor = iconOptions && this.options.icon.options.iconAnchor;
if (iconAnchor) {
iconAnchor = (iconAnchor[0] + 'px ' + iconAnchor[1] + 'px');
iconAnchor = L.point(iconAnchor);
iconAnchor = (iconAnchor.x + 'px ' + iconAnchor.y + 'px');
}
this.options.rotationOrigin = this.options.rotationOrigin || iconAnchor || 'center bottom' ;
this.options.rotationAngle = this.options.rotationAngle || 0;