1.0.1 • Published 4 years ago

l-subpixel-position v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Leaflet Subpixel Position

This leaflet plugin adds subpixel positioning methods for leaflet objects.

Subpixel Demo

Demo

Compatibility with Leaflet Versions

Compatible with the latest stable Leaflet version leaflet-1.5.

Browser Compatibility

This plugin useful in webkit-based browsers. It is compatible but useless in Firefox, because it does not support displaying things with subpixels.

Usage

Add this line to your HTML file after Leaflet:

<script type="text/javascript" src="https://unpkg.com/l-subpixel-position@1.0.0/index.js"></script>

Or you can use npm and es6 modules:

npm i leaflet l-subpixel-position --save
import 'leaflet';
import 'l-subpixel-position';

Then add can call setLatLngPrecise method of your L.Marker instances:

const myMarker = L.Marker([48.8567, 2.3508]).addTo(map);

...
myMarker.setLatLngPrecise(latlng)

API

Plugin adds setLatLngPrecise method to L.Marker:

MethodReturnsDescription
setLatLngPrecise(<LatLng> latlng)thisChanges the marker position to the given point with subpixel accuracy.

This method has the same behaviour as standard setLatLng.

License

MIT