Olymo / LeafletPolylinePoints

Leaflet plug-in to add circular points on polyline coordinates.

Home Page:https://www.npmjs.com/package/@whatsaaaaa/leafletpolylinepoints

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@whatsaaaaa/leafletpolylinepoints

Leaflet plug-in to add circular points on polyline coordinates.

Install

npm i @whatsaaaaa/leafletpolylinepoints

Usage

import { addCircularPointToPolyline } from "@whatsaaaaa/leafletpolylinepoints";

addCircularPointToPolyline(
  [
    {
      latitude: route.latitude,
      longitude: route.longitude,
    },
  ],
  map,
  {
    color: "red",
    bindPopup: true,
    popupContent: `Popup Content!`,
  }
);

Parameters

  • coordinates: Array of objects (lat, lng)
  • map: Obhect
  • options: Object

Options

  • color - Default 'blue'. Change the color of circle
  • bindPopup - Default 'false'. On click binds popup.
  • popupContent - What to show in popup.

Recommended CSS

.polyline-point > div {
  margin-left: -1px;
  margin-top: -3px;
  transform-origin: center center;
}

About

Leaflet plug-in to add circular points on polyline coordinates.

https://www.npmjs.com/package/@whatsaaaaa/leafletpolylinepoints

License:MIT License


Languages

Language:JavaScript 100.0%