Skip to content

Commit

Permalink
Merge pull request #25 from infra-geo-ouverte/master
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
drekss committed Nov 9, 2019
2 parents f2a365a + 81ac778 commit 776658c
Show file tree
Hide file tree
Showing 99 changed files with 1,539 additions and 530 deletions.
1 change: 1 addition & 0 deletions demo/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<mat-toolbar color="primary" class="example-toolbar">
<button mat-icon-button (click)="snav.toggle()"><mat-icon svgIcon="menu"></mat-icon></button>
<h1>{{title}}</h1>
<h5>{{version.lib}}</h5>
</mat-toolbar>

<mat-sidenav-container class="example-sidenav-container" [style.marginTop.px]="mobileQuery.matches ? 56 : 0">
Expand Down
3 changes: 3 additions & 0 deletions demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
Renderer2
} from '@angular/core';

import { version } from '@igo2/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
Expand All @@ -15,6 +17,7 @@ export class AppComponent implements OnDestroy {
mobileQuery: MediaQueryList;

public title = 'IGO';
public version = version;
private themeClass = 'deeppurple-theme';
private _mobileQueryListener: () => void;

Expand Down
51 changes: 26 additions & 25 deletions demo/src/app/geo/feature/feature.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
styleUrls: ['./feature.component.scss']
})
export class AppFeatureComponent implements OnInit, OnDestroy {

public map = new IgoMap({
controls: {
attribution: {
Expand Down Expand Up @@ -52,7 +51,7 @@ export class AppFeatureComponent implements OnInit, OnDestroy {
]
};

public store = new FeatureStore([], {map: this.map});
public store = new FeatureStore([], { map: this.map });

constructor(
private languageService: LanguageService,
Expand Down Expand Up @@ -90,11 +89,7 @@ export class AppFeatureComponent implements OnInit, OnDestroy {
type: 'Feature',
geometry: {
type: 'LineString',
coordinates: [
[-72, 47.8],
[-73.5, 47.4],
[-72.4, 48.6]
]
coordinates: [[-72, 47.8], [-73.5, 47.4], [-72.4, 48.6]]
},
projection: 'EPSG:4326',
properties: {
Expand All @@ -108,11 +103,7 @@ export class AppFeatureComponent implements OnInit, OnDestroy {
type: 'Feature',
geometry: {
type: 'Polygon',
coordinates: [[
[-71, 46.8],
[-73, 47],
[-71.2, 46.6]
]]
coordinates: [[[-71, 46.8], [-73, 47], [-71.2, 46.6]]]
},
projection: 'EPSG:4326',
properties: {
Expand All @@ -123,18 +114,22 @@ export class AppFeatureComponent implements OnInit, OnDestroy {
}
]);

this.dataSourceService
.createAsyncDataSource({
type: 'osm'
this.layerService
.createAsyncLayer({
title: 'MVT test',
visible: true,
sourceOptions: {
type: 'mvt',
url:
'https://ahocevar.com/geoserver/gwc/service/tms/1.0.0/ne:ne_10m_admin_0_countries@EPSG:900913@pbf/{z}/{x}/{-y}.pbf',
queryable: true
},
mapboxStyle: {
url: 'assets/mapboxStyleExample-vectortile.json',
source: 'ahocevar'
}
})
.subscribe(dataSource => {
this.map.addLayer(
this.layerService.createLayer({
title: 'OSM',
source: dataSource
})
);
});
.subscribe(l => this.map.addLayer(l));

this.dataSourceService
.createAsyncDataSource({
Expand All @@ -143,7 +138,14 @@ export class AppFeatureComponent implements OnInit, OnDestroy {
.subscribe(dataSource => {
const layer = this.layerService.createLayer({
title: 'Vector Layer',
source: dataSource
source: dataSource,
animation: {
duration: 2000
},
mapboxStyle: {
url: 'assets/mapboxStyleExample-feature.json',
source: 'source_nameX'
}
}) as VectorLayer;
this.map.addLayer(layer);
this.store.bindLayer(layer);
Expand All @@ -155,5 +157,4 @@ export class AppFeatureComponent implements OnInit, OnDestroy {
ngOnDestroy() {
this.store.destroy();
}

}
3 changes: 2 additions & 1 deletion demo/src/app/geo/layer/layer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<ng-template #igoLayerItemToolbar let-layer="layer">
<igo-metadata-button [layer]="layer"></igo-metadata-button>
<igo-download-button [layer]="layer"></igo-download-button>
<igo-ogc-filter-button [ogcFiltersInLayers]="true" [layer]="layer"></igo-ogc-filter-button>
<igo-ogc-filter-button [header]="true" [layer]="layer"></igo-ogc-filter-button>
<igo-time-filter-button [header]="true" [layer]="layer"></igo-time-filter-button>
<igo-track-feature-button [layer]="layer" [trackFeature]="true"></igo-track-feature-button>
</ng-template>

Expand Down
16 changes: 12 additions & 4 deletions demo/src/app/geo/ogc-filter/ogc-filter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,16 @@ export class AppOgcFilterComponent {
ogcFilters: {
enabled: true,
editable: true,
pushButtons: [
pushButtons: {
groups : [
{title: 'Nom du group1', name: '1', ids : ['id1']},
{title: 'Nom du group2', name: '2', ids : ['id1', 'id2']},
],
bundles: [
{
id: 'id1',
logical: 'Or',
ogcPushButtons: [
buttons: [
{
title: 'Radar photo fixe',
enabled: true,
Expand Down Expand Up @@ -181,9 +187,10 @@ export class AppOgcFilterComponent {
]
},
{
id: 'id2',
logical: 'Or',
vertical: true,
ogcPushButtons: [
buttons: [
{
title: 'Montréal & Laval',
enabled: false,
Expand Down Expand Up @@ -226,7 +233,8 @@ export class AppOgcFilterComponent {
}
]
}
],
]
},
allowedOperatorsType: OgcFilterOperatorType.Basic
},
paramsWFS: {
Expand Down
9 changes: 6 additions & 3 deletions demo/src/app/geo/query/query.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export class AppQueryComponent {
this.map.addLayer(
this.layerService.createLayer({
title: 'WMS',
source: dataSource
source: dataSource,
sourceOptions: dataSource.options
})
);
});
Expand All @@ -100,7 +101,8 @@ export class AppQueryComponent {
this.map.addLayer(
this.layerService.createLayer({
title: 'WMS html with a pre call in GML',
source: dataSource
source: dataSource,
sourceOptions: dataSource.options
})
);
});
Expand All @@ -119,7 +121,8 @@ export class AppQueryComponent {
this.map.addLayer(
this.layerService.createLayer({
title: 'Vector Layer',
source: dataSource
source: dataSource,
sourceOptions: dataSource.options
})
);
this.addFeatures(dataSource as FeatureDataSource);
Expand Down
78 changes: 78 additions & 0 deletions demo/src/assets/mapboxStyleExample-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"version": 8,
"name": "Empty Style",
"metadata": {"maputnik:renderer": "mbgljs"},
"sources": {
"source_nameX": {
"type": "vector",
"minZoom": 0,
"maxZoom": 22
}
},
"sprite": "",
"layers": [
{
"id": "labelling",
"type": "symbol",
"source": "source_nameX",
"paint": {
"text-color": "rgba(0, 0, 0, 1)",
"text-halo-color": "rgba(255, 255, 255, 1)"
},
"layout": {
"visibility": "visible",
"text-anchor": "top-right",
"text-field": "{description}",
"text-font": [
"Noto Sans Regular"
],
"text-max-width": 16,
"text-size": 16,
"text-padding": 3,
"text-allow-overlap": false,
"icon-text-fit": "both"
}
},
{
"id": "circle_style",
"type": "circle",
"source": "source_nameX",
"filter": ["any",["==","name","Name 1"]],
"paint": {
"circle-color": "rgba(0, 255, 0, 1)",
"circle-radius": 7,
"circle-blur": 0.5,
"circle-stroke-color": "rgba(0, 0, 0, 1)",
"circle-stroke-width": 2
},
"layout": { "visibility": "visible" }
},
{
"id": "line_style",
"type": "line",
"source": "source_nameX",
"filter": ["any",["==","name","Name 2"]],
"paint": {
"line-color": "rgba(0, 255, 0, 1)"
},
"layout": {
"visibility": "visible",
"line-cap": "round",
"line-join": "round"
}
},
{
"id": "poly_style",
"type": "fill",
"source": "source_nameX",
"filter": ["any",["==","name","Name 3"]],
"paint": {
"fill-color": "rgba(0, 255, 0, 1)"
},
"layout": {
"visibility": "visible"
}
}
],
"id": "xsk9pp6fv"
}
92 changes: 92 additions & 0 deletions demo/src/assets/mapboxStyleExample-vectortile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"version": 8,
"name": "Example Style Vector Tile",
"metadata": {"maputnik:renderer": "mbgljs"},
"sources": {
"ahocevar": {
"type": "vector",
"minZoom": 0,
"maxZoom": 22
}
},
"sprite": "",
"layers": [
{
"id": "line_style_canada",
"type": "line",
"source": "ahocevar",
"source-layer": "ne_10m_admin_0_countries",
"filter": ["any", ["==", "admin", "Canada"]],
"paint": {
"line-color": "rgba(0, 0, 0, 1)"
},
"layout": {
"visibility": "visible",
"line-cap": "round",
"line-join": "round"
}
},
{
"id": "fill_style_canada",
"type": "fill",
"source": "ahocevar",
"source-layer": "ne_10m_admin_0_countries",
"filter": ["any", ["==", "admin", "Canada"]],
"paint": {
"fill-color": "rgba(255, 10, 10, 0.5)"
},
"layout": {
"visibility": "visible",
"line-cap": "round",
"line-join": "round"
}
},
{
"id": "line_style_usa",
"type": "line",
"source": "ahocevar",
"source-layer": "ne_10m_admin_0_countries",
"filter": ["any", ["==", "admin", "United States of America"]],
"paint": {
"line-color": "rgba(0, 50, 255, 1)",
"line-width": 3
},
"layout": {
"visibility": "visible",
"line-cap": "round",
"line-join": "round"
}
},
{
"id": "fill_style_usa",
"type": "fill",
"source": "ahocevar",
"source-layer": "ne_10m_admin_0_countries",
"filter": ["any", ["==", "admin", "United States of America"]],
"paint": {
"fill-color": "rgba(0, 50, 255, 0.5)"
},
"layout": {
"visibility": "visible",
"line-cap": "round",
"line-join": "round"
}
},
{
"id": "fill_style_usa",
"type": "fill",
"source": "ahocevar",
"source-layer": "ne_10m_admin_0_countries",
"filter": ["any", ["==", "admin", "Liechtenstein"]],
"paint": {
"fill-color": "rgba(255, 255, 0, 1)"
},
"layout": {
"visibility": "visible",
"line-cap": "round",
"line-join": "round"
}
}
],
"id": "vectortileid"
}
5 changes: 5 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ gulp.task('core:bumpVersion', done => {
)
.pipe(gulp.dest('./packages/core/.'));

gulp
.src(['./packages/core/src/lib/config/version.ts'])
.pipe(replace(/lib: '[A-Za-z0-9\.\-]+'/g, `lib: '${version}'`))
.pipe(gulp.dest('./packages/core/src/lib/config/.'));

done();
});

Expand Down
Loading

0 comments on commit 776658c

Please sign in to comment.