ngx-leaflet

Property binding map click event with dropdown select input in ngx-leaflet/Angular 2

*爱你&永不变心* 提交于 2019-12-13 19:48:55
问题 I have a map with regional polygons. Below the map, I have a dropdown select input that dynamically reads in the polygon names as options. When the user clicks the regional polygons on the map, I want the dropdown select input to update with the selected polygon name (which exists as the 'name' field in the geojson file). I figure that the way to achieve this is to use property binding in the HTML template file. So in my select class, I set the value property as the value clicked , like so:

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

风格不统一 提交于 2019-12-11 04:26:59
问题 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 that polygon and reveals points associated with that polygon, let's say cities. Clicking on a single point/city bores down further and reveals another group of points associated with the first clicked point, such as all libraries within the selected

Getting GeoJSON Data to Leaflet Map using ngx-leaflet, HTTPClient and Angular2+

天大地大妈咪最大 提交于 2019-12-08 00:58:05
问题 I'm using the ngx-leaflet demo to try and get a GeoJson from a get request to display on the LeafLet Map. I have built a valid GeoJson using http://geojson.io/, and double checked it using the http://geojsonlint.com/ (Thanks for those tools guys) We have no errors in the compilation or displaying in the console log. Serves fine but our geojson object is nowhere to be found. I'm just looking to display the geojson data on the map. Any help or advice is appreciated. Angular CLI: 1.6.5 Node: 8.3

Coordinates on clickevent

我的未来我决定 提交于 2019-12-05 13:15:33
I'm new to @asymmetrik/ngx-leaflet and Angular in general, so this is maybe just a newbie-issue... I have an Angular.io (v5) project using the @asymmetrik/ngx-leaflet-tutorial-ngcli Now I would like to get the coordinates of the point I clicked on the map. According to Issue #51 get coordinates on click? , I added this: map.on('click', () => { console.log(e.latlng); }); to: onMapReady(map: Map) { map.fitBounds(this.route.getBounds(), { padding: point(24, 24), maxZoom: 12, animate: true }); map.on('click', () => { console.log(e.latlng); }); } that gives me a runtime error: Cannot find name 'e'.

Getting the list of markers when zoomed in leaflet map

别来无恙 提交于 2019-12-04 09:15:28
I am new to leaflet. I have set up the map following the steps on https://github.com/Asymmetrik/ngx-leaflet I am trying to get the list of markers in the zoomed in area of the map that can be used in getting the objects in focus. How do I do this with ngx-leaflet in angular 4? First, set up a handler on the (leafletMapReady) so you can get a reference to the map. In onMapReady , you can store the reference to the map inside your component so you can use it later. <div class="map" leaflet [leafletLayers]="layers" (leafletMapReady)="onMapReady($event)" [leafletOptions]="options"> </div> To