Network is now a feature's attribute (no longer in tags' hstore)
This commit is contained in:
parent
e7c9d0e7cb
commit
c08cf8bc3f
|
@ -320,7 +320,7 @@ const styles = {
|
|||
}),
|
||||
},
|
||||
getParameters: (feature: Feature) => {
|
||||
let tags = feature.get('tags');
|
||||
// let tags = feature.get('tags');
|
||||
// try {
|
||||
// tags = JSON.parse(feature.get('tags'));
|
||||
// } catch (error) {
|
||||
|
@ -332,19 +332,17 @@ const styles = {
|
|||
// feature,
|
||||
// });
|
||||
// }
|
||||
if (getZoomInteger() < 12 && !['iwn', 'nwn'].includes(tags.network)) {
|
||||
const network = feature.get('network');
|
||||
if (getZoomInteger() < 12 && !['iwn', 'nwn'].includes(network)) {
|
||||
return null;
|
||||
}
|
||||
if (
|
||||
getZoomInteger() < 14 &&
|
||||
!['iwn', 'nwn', 'lwn'].includes(tags.network)
|
||||
) {
|
||||
if (getZoomInteger() < 14 && !['iwn', 'nwn', 'lwn'].includes(network)) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
isSelected: feature.get('isSelected') ?? false,
|
||||
// isSelected: feature.get('isSelected') ?? false,
|
||||
name: feature.get('name'),
|
||||
network: tags.network,
|
||||
network,
|
||||
};
|
||||
},
|
||||
getStyle: memoize((params: any) => {
|
||||
|
@ -464,7 +462,7 @@ const styles = {
|
|||
};
|
||||
|
||||
export const style = (feature: Feature, resolution: number) => {
|
||||
// console.log({ caller: 'style', feature, values: feature.values_ });
|
||||
// console.log({ caller: 'style', feature, values: feature.values_ });
|
||||
const type = (
|
||||
feature.get('type') !== undefined
|
||||
? feature.get('type')
|
||||
|
|
|
@ -112,12 +112,12 @@ export const Overlays: Component<Props> = ({ map }) => {
|
|||
// const vectorTileSource = constructSource();
|
||||
|
||||
const vectorTileSource = new VectorTileSource({
|
||||
url: 'https://geo.dyomedea.com/geoserver/gwc/service/wmts/rest/hiking/EPSG:900913/EPSG:900913:{z}/{y}/{x}?format=application/json;type=geojson',
|
||||
// url: 'https://geo.dyomedea.com/geoserver/gwc/service/wmts/rest/hiking/EPSG:900913/EPSG:900913:{z}/{y}/{x}?format=application/vnd.mapbox-vector-tile',
|
||||
// url: 'https://geo.dyomedea.com/geoserver/gwc/service/wmts/rest/hiking/EPSG:900913/EPSG:900913:{z}/{y}/{x}?format=application/json;type=geojson',
|
||||
url: 'https://geo.dyomedea.com/geoserver/gwc/service/wmts/rest/hiking/EPSG:900913/EPSG:900913:{z}/{y}/{x}?format=application/vnd.mapbox-vector-tile',
|
||||
// url: 'http://localhost:8080/geoserver/gwc/service/tms/1.0.0/test%3Atransportation@EPSG%3A900913@pbf/{z}/{x}/{-y}.pbf',
|
||||
// url: 'https://geo.dyomedea.com/services/spain/tiles/{z}/{x}/{y}.pbf',
|
||||
format: new GeoJSON({ dataProjection: 'EPSG:900913' }),
|
||||
// format: new MVT({ featureClass: Feature }),
|
||||
// format: new GeoJSON({ dataProjection: 'EPSG:900913' }),
|
||||
format: new MVT({ featureClass: Feature }),
|
||||
maxZoom: 15,
|
||||
tileSize: 256,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue