Skip to content

This leaflet plugin adds subpixel positioning methods for leaflet objects.

License

Notifications You must be signed in to change notification settings

itanka9/l-subpixel-position

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/[email protected]/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:

Method Returns Description
setLatLngPrecise(<LatLng> latlng) this Changes the marker position to the given point with subpixel accuracy.

This method has the same behaviour as standard setLatLng.

License

MIT

About

This leaflet plugin adds subpixel positioning methods for leaflet objects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published