Skip to content
Snippets Groups Projects
Commit 9bd0cbb6 authored by Callari, Roberto's avatar Callari, Roberto
Browse files

clusters

parent c972b275
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,8 @@
"node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.theme.default.min.css",
"src/app/@theme/styles/styles.scss",
"node_modules/leaflet-timedimension/dist/leaflet.timedimension.control.css",
"node_modules/leaflet.awesome-markers/dist/leaflet.awesome-markers.css"
"node_modules/leaflet.awesome-markers/dist/leaflet.awesome-markers.css",
"node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css"
],
"scripts": [
"node_modules/pace-js/pace.min.js",
......
......@@ -1239,6 +1239,11 @@
"resolved": "https://registry.npmjs.org/@asymmetrik/ngx-leaflet/-/ngx-leaflet-3.0.1.tgz",
"integrity": "sha512-rQaqLM/n9gIPMKkNDOd3+H1kiQiuXtY5KVOM5cPJCoetaN9oIJrCATQHPRO47j1os8Wqcv5I0BKEH/EtTtVuiA=="
},
"@asymmetrik/ngx-leaflet-markercluster": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@asymmetrik/ngx-leaflet-markercluster/-/ngx-leaflet-markercluster-5.0.1.tgz",
"integrity": "sha512-XqRSgMKZN/670/nRXtjZ98fniuCzvQnZ5EDEOr+coEC4OI0OYeDIvAN253C5U8kJX6hIdzDtQcbOrC1milWUBw=="
},
"@babel/code-frame": {
"version": "7.12.11",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
......@@ -3271,6 +3276,14 @@
"@types/leaflet": "*"
}
},
"@types/leaflet.markercluster": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/@types/leaflet.markercluster/-/leaflet.markercluster-1.4.4.tgz",
"integrity": "sha512-BQAilNWlBpYl4+PrsJXLOh4vyv7KfWi5kh3Fclg5y4gEeNeXKqhS6y1zzBB4+wcTuVUnMWfm2G0MfqA4yA5A5A==",
"requires": {
"@types/leaflet": "*"
}
},
"@types/marked": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@types/marked/-/marked-2.0.2.tgz",
......@@ -12389,6 +12402,11 @@
"resolved": "https://registry.npmjs.org/leaflet.heat/-/leaflet.heat-0.2.0.tgz",
"integrity": "sha1-EJ2M9Ybwre5B8Fr/Ax4np3/swik="
},
"leaflet.markercluster": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/leaflet.markercluster/-/leaflet.markercluster-1.5.0.tgz",
"integrity": "sha512-Fvf/cq4o806mJL50n+fZW9+QALDDLPvt7vuAjlD2vfnxx3srMDs2vWINJze4nKYJYRY45OC6tM/669C3pLwMCA=="
},
"less": {
"version": "3.12.2",
"resolved": "https://registry.npmjs.org/less/-/less-3.12.2.tgz",
......@@ -23532,7 +23550,8 @@
},
"ssri": {
"version": "6.0.1",
"resolved": "",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
"dev": true,
"requires": {
"figgy-pudding": "^3.5.1"
......
import { NgModule } from '@angular/core';
import { GoogleMapsModule } from '@angular/google-maps';
import { LeafletModule } from '@asymmetrik/ngx-leaflet';
import { LeafletMarkerClusterModule } from '@asymmetrik/ngx-leaflet-markercluster';
import { NgxEchartsModule } from 'ngx-echarts';
import { NbCardModule, NbRadioModule, NbSpinnerModule, NbDatepickerModule, NbInputModule, NbButtonModule, NbSelectModule, NbTimepickerModule} from '@nebular/theme';
import { ThemeModule } from '../../@theme/theme.module';
......@@ -27,6 +28,7 @@ import { TrafficFilterComponent } from './traffic-filter/traffic-filter.componen
NbButtonModule,
NbSelectModule,
NbTimepickerModule,
LeafletMarkerClusterModule
],
exports: [],
declarations: [
......
......@@ -82,6 +82,7 @@ export class TrafficComponent implements OnInit {
* Call API and display a Layer on MAP with Stops
*/
private displayStops() {
let clusterData = L.markerClusterGroup();
this.messinaClient.getStops().subscribe(res => {
let stopLayer = L.geoJSON(res['results'], {
pointToLayer: (feature, latlng) => {
......@@ -98,20 +99,22 @@ export class TrafficComponent implements OnInit {
}
});
// this.layers.push(this.stopLayer);
this.layersControl.overlays['Layer STOPs'] = stopLayer;
clusterData.addLayer(stopLayer);
this.layersControl.overlays['Layer STOPs'] = clusterData;
});
}
types=[];
// types=[];
/**
* Call API and display a Layer on MAP with POIs
*/
private displayPOIs() {
let clusterData = L.markerClusterGroup();
this.messinaClient.getPOI().subscribe(res => {
let poiLayer = L.geoJSON(res['results'], {
pointToLayer: (feature, latlng) => {
if(this.types.indexOf(feature.properties['type'])<0){
this.types.push(feature.properties['type']);
}
// if(this.types.indexOf(feature.properties['type'])<0){
// this.types.push(feature.properties['type']);
// }
let icon = this.getIcon(feature.properties['type']);
......@@ -126,8 +129,8 @@ export class TrafficComponent implements OnInit {
return L.marker(latlng, { icon: markerIcon })
}
});
console.log(JSON.stringify(this.types));
this.layersControl.overlays['Layer POIs']=poiLayer;
clusterData.addLayer(poiLayer);
this.layersControl.overlays['Layer POIs']=clusterData;
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment