Skip to content

fergolive/Angular-leaflet-map

Repository files navigation

Integration Angular - Leaflet

Js docs

Angular tutorial

How to use:

  • clone this repo
  • npm install
  • ng serve

Notes

Js docs

Angular tutorial

Part 1

https://www.digitalocean.com/community/tutorials/angular-angular-and-leaflet

Part 2

https://www.digitalocean.com/community/tutorials/angular-angular-and-leaflet-marker-service

Examples

Tiles layers

https://leaflet-extras.github.io/leaflet-providers/preview/

Marker

svg icons https://www.svgrepo.com/vectors/marker/

create marker

 addMarker(){
    L.marker([-30.889332, -55.557966]).addTo(this.map)
    .bindPopup('A pretty CSS popup.<br> Easily customizable.')
    .openPopup();
  }

get position and new create marker

 this.map.on('click',  ($event:any)=> {
      let lat=$event.latlng.lat;
      let lng=$event.latlng.lng;
    
      L.marker([lat,lng],{draggable:true,icon: myIcon}).addTo(this.map)
      
    });

Properties

About

How to use Angular and leaflet maps

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages