- Put two script tags similar to this in the head of your index.html:
<script
type="module"
src="https://unpkg.com/@paraboly/pwc-leaflet-entity-selector@latest/dist/pwc-leaflet-entity-selector/pwc-leaflet-entity-selector.esm.js"
></script>
<script
nomodule
src="https://unpkg.com/@paraboly/pwc-leaflet-entity-selector@latest/dist/pwc-leaflet-entity-selector/pwc-leaflet-entity-selector.js"
></script>
- Run
npm install @paraboly/pwc-leaflet-entity-selector --save
- Put a script tag similar to this
<script src='node_modules/@paraboly/pwc-leaflet-entity-selector/dist/pwc-leaflet-entity-selector.js'></script>
in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
- Run
npm install @paraboly/pwc-leaflet-entity-selector --save
- Add an import to the npm packages
import @paraboly/pwc-leaflet-entity-selector;
- Then you can use the element anywhere in your template, JSX, html etc
- Add custom element to any html or jsx file
<pwc-leaflet-entity-selector></pwc-leaflet-entity-selector>
- Then, bind map to custom element
var pwcEntitySelectorControl = document.querySelector(
"pwc-leaflet-entity-selector"
);
pwcEntitySelectorControl.map = map; // Set leaflet map instance
pwcEntitySelectorControl.addEventListener("controlEvents", control => {
console.log(control);
});
- Check
src/index.html
for more details
SchemeSonic, [email protected]
This repository is available under the MIT license.
See the LICENSE file for more info.