Questions tagged [ngx-leaflet]

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

149 questions
1
vote
1 answer

how can i pass lat,long from outside to create a leaflet marker angular

This is a working code to place a marker using leaflet angular for predefined lat,longs. Now i want to customize this by passing lat,long when addmarker button is pressed. Can anyone advise ? Lat long infomration is not available when page loads…
sunny
  • 51
  • 12
1
vote
4 answers

How to use the Angular @HostListener onLoad to get the current width of the viewport?

I'm currently using the Angular @HostListener to get the current width of the viewport onResize() like this: @HostListener('window:resize', ['$event']) onResize(event?) { window.innerWidth <= 400 ? this.width = 200 : this.width = 400; …
Codehan25
  • 2,704
  • 10
  • 47
  • 94
1
vote
1 answer

Leaflet draw event "draw:deleted" not deleting layer

Please note that i am using @asymmetrik/ngx-leaflet-draw for Angular. I'm configuring a map where the user can draw either rectangles or polygons. I then save these to a layerGroup based on the onDrawCreated event, this is working perfectly. I'm…
Koronag
  • 157
  • 1
  • 15
1
vote
1 answer

LeafletJS image overlay set bounds

I'm using LeafletJS map. I need to use an image overlay. I have done it like so: onMapReady(event: any) { this.layers.push(imageOverlay(this.imgSrc + "map.png", [[35.334847, 25.328072], [35.337847, 25.339072]])); // This is the overlay …
Sampath
  • 63,341
  • 64
  • 307
  • 441
1
vote
1 answer

How to create custom draw button for ngx-leaflet with ngx-leaflet-draw

I want to create a custom button, which enables the Polyline drawer on click. it's similar to How to click a button and start a new polygon without using the Leaflet.draw UI, but I want to do that with angular (7), ngx-leaflet and ngx-leaflet-draw.…
MojioMS
  • 1,583
  • 4
  • 17
  • 42
1
vote
2 answers

How to use colorFilter with ngx-leaflet on Angular6

How can i use a Leaflet plugin like Leaflet.TileLayer.ColorFilter with ngx-leaflet on Angular 6 ? I think my problem is in the import of the project because i want to use a function created by the ColorFilter plugin but this plugin is not a part of…
1
vote
1 answer

Is there alternative for google places autocomplete in leaflet with angular6?

I am working in an angular6 project. I need to integrate location in reactive form. Google map requires payment, so my client asked me to find an open source one. I ended up with ngx-leaflet.But I couldn't find any google places autocomplete…
Rahul K R
  • 191
  • 4
  • 20
1
vote
1 answer

Add layergroups to map and update by name

I'm currently using ngx-leaflet 4.0.0 with Angular 6.x and RXjs 6.x. I have a bunch of observable that generate/stream Layers which should be drawn on the map. When we have a lot of markers then, as you might expect, the performance degrades. This…
Saab
  • 981
  • 3
  • 11
  • 34
1
vote
1 answer

How to set maxBoundsViscosity options?

I want to set maxBoundsViscosity of the Panning Inertia Options. Because there is no binding and no set function of the map element i dont know how to. Is there a workaround or something?
TheSorm
  • 137
  • 12
1
vote
1 answer

Using getBounds/fitBounds on a featureGroup with ngx-leaflet in angular

In the app I'm creating, I dynamically add groups of points to a featureGroup that is referenced in a nested map click event. So the gist is that I have a map of a country with different regions displayed. Clicking a region fits the map bounds to…
Lauren
  • 1,035
  • 1
  • 14
  • 32
1
vote
0 answers

White lines shown in rendering of ngx-leaflet layers

Using Leaflet 1.3.1, ngx-leaflet 2.5, Angular 4.4.5 I am rendering the map in a modal and in some cases, white lines will form on the map: Has anyone else experienced this and know what could be causing it?
wvarner
  • 116
  • 2
  • 7
1
vote
1 answer

set current Location marker

I worked through this tutorial and got it all up and running. Now I want to get my current browser Location and set a marker for it onMapReady. I am pretty new to programming and I'm just starting to learn about Angular, so sorry for this noobie…
ArminFB
  • 31
  • 1
  • 4
1
vote
0 answers

Layer Control not visible Webpack 4

I'm using ngx-leaflet with webpack 4 and I'm having a problem displaying the layers control image. The default marker icons show up fine since I'm using import iconname from 'leaflet/dist/images/layers.png' etc using the file-loader. The project…
jurgen w
  • 243
  • 1
  • 2
  • 14
1
vote
1 answer

Remove or hide LayersControl

I want to remove or hide LayersControl because I change the layer of the map with an external menu. Is this possible? I have this code: HTML
Aw3same
  • 930
  • 4
  • 13
  • 38
1
vote
1 answer

Importing Leaflet Draw NGX for angular 4

I followed the steps from the main git: https://github.com/Asymmetrik/ngx-leaflet first I installed the required libraries (leaflet, leaflet-draw, leaflet-ngx, and leaflet-draw-ngx) then I declared the required directive imports in app.module. In…
zahma
  • 412
  • 4
  • 14