Questions tagged [ngx-leaflet]

Leaflet components for Angular.io published to npm under @asymmetrik/ngx-leaflet

149 questions
0
votes
1 answer

Import leaflet plugin into Angular project

I'm looking to import the plugin https://github.com/ScanEx/Leaflet.imageTransform into an Angular project. I've add the script into the src folder. it's imported in angular.json file in the scripts sections. In my map component I created a variable…
Jérôme
  • 403
  • 1
  • 3
  • 13
0
votes
1 answer

Compile time error on Layers, but runtime okay

Code below works fine at runtime, but receives an error at compile time which prevents me from building production code unless I ignore errors, which I don't want to do. I'm unable to cast to a marker object as marker appears to be a…
0
votes
0 answers

Add custom guid to Marker icon

Using ngx-leaflet and Angular 7+ TypeScript, how do I go about adding a custom property to store an id/guid for a map icon I placed? var newMarker = marker( [markerObj.latitude, markerObj.longitude], { …
0
votes
2 answers

How to make baseLayers & overlays selected by default using @asymmetrik/ngx-leaflet

stackblitz code@asymmetrik/ngx-leaflet How to make baseLayers & overlays selected by default ? I have used layersControl to show these baseLayers and overlays.
shoban m.r
  • 36
  • 6
0
votes
0 answers

Ngx Leaflet GeoJson with layers - how to only render a part (square) of the map for performance optimisation?

For performance purposes I am looking for help with only displaying a part of the map with toggleable layers. Since my GeoJSON file contains too many features, the map gets really laggy, so I want to only render a part (square) of the map and when…
Pungiish
  • 417
  • 1
  • 4
  • 12
0
votes
1 answer

Open a Angular Material Dialog after an leaflet on("click", function()) action

I want to open an Angular Material Dialog when I click on a leaflet circle. The Dialog appears but with strange behavior. This strange behavior doesn't appear when I open the Dialog with a normal Button (click) event. I try to call the function…
Buzzet
  • 693
  • 1
  • 7
  • 19
0
votes
2 answers

ngx-leaflet / GeoJson / Country Border

We are using Leaflet already on one of our site but now we are migrating to Angular. Now we are trying to reproduce it using Ngx-Leaflet. But we don't have the country borders... What we have right now: In the component.html
Jean-Philippe M
  • 731
  • 1
  • 7
  • 19
0
votes
1 answer

gradually introducing ngx-leaflet into an app with extensive leaflet use

I am developing in a large angular 8 app that has many components that use leaflet. The existing components use leaflet and some plugins directly, imported like so: import * as L from 'leaflet' import 'leaflet.markercluster' which has been…
0
votes
1 answer

Leaflet: Get inner-most layer on mouse click and mouse hover on intersecting rectangles

I am trying to display a set of rectangles on a map. I am able to draw all of them using: var rec = L.rectangle(bounds, {color: "#ff7800", weight: 1}) .bindTooltip('Z1', { sticky: true}).addTo(map); However, when I hover over the…
semantic_c0d3r
  • 491
  • 1
  • 4
  • 18
0
votes
1 answer

No markers and popup visible on map

I am using ngx-leaflet plugin for leaflet. I have setup the base layers and added a listener for leafletMapReady event. In my handler, I tried adding a marker and a custom popup. The code for the handler is given below: initMarkers(map: L.Map) { …
Abrar Hossain
  • 2,594
  • 8
  • 29
  • 54
0
votes
1 answer

Can I display a Leaflet map in a web component built with Angular Elements?

I want to display a map with ngx-leaflet and use it in a web component built with Angular Elements. The problem I'm facing is that new tiles are not rendered on the screen after interacting with the map. I've disabled zones and am running manual…
pberden
  • 130
  • 3
  • 12
0
votes
1 answer

How do I change the tile layer from OpenStreetMap to Stamen

I am trying to use Stamen maps with ngx-leaflet. The documentation for integrating leaftlet is here. I am not sure how to integrate it with ngx-leaflet. Is there a way to get a reference to the leaflet, L object in ngx-leaflet? Are there better ways…
Abrar Hossain
  • 2,594
  • 8
  • 29
  • 54
0
votes
2 answers

Adding multiple overlays to leaflet's layers control

I have a LayerGroup in which several ImageOverlays are placed. These are all displayed correctly. Now I would like to be able to show and hide this LayerGroup within the LayersControl. My LayerGroup is defined within a function like…
Codehan25
  • 2,704
  • 10
  • 47
  • 94
0
votes
1 answer

Add leaflet ImageOverlay to Layers Control

I use leaflet with the Angular package ngx-leaflet and just trying to get my layer for ImageOverlays in my LayersControl, so I can show or hide this layer in the map based on a checkbox. Somehow it does not work as described in the documentation.…
0
votes
1 answer

How to store markers (with id) and populate map for each user using mongodb?

I'm a complete noob so bear with me please - Currently users can add markers and my plan is to use the ondraw event to get the marker lat/lng and store that in mongodb, however i don't know how to get the individual markerID - ._leaflet_id returns…