Moving vector tile layer's MVT to Feature (instead of RenederdFeature) to prepare for clustering.

This commit is contained in:
Eric van der Vlist 2023-01-17 12:40:38 +01:00
parent 4917d27c9c
commit 12466d214c
2 changed files with 4 additions and 7 deletions

View File

@ -280,7 +280,7 @@ const styles = {
}); });
}, memoizeOptions), }, memoizeOptions),
}, },
LineString: { way: {
strokes: { strokes: {
iwn: new Stroke({ iwn: new Stroke({
color: [174, 33, 219, 0.8], color: [174, 33, 219, 0.8],
@ -312,7 +312,7 @@ const styles = {
console.log({ caller: 'getStyle', params }); console.log({ caller: 'getStyle', params });
const { isSelected, name, network } = params; const { isSelected, name, network } = params;
return new Style({ return new Style({
stroke: styles.LineString.strokes[network], stroke: styles.way.strokes[network],
text: new Text({ text: new Text({
text: name, text: name,
font: 'bold 14px "Open Sans", "Arial Unicode MS", "sans-serif"', font: 'bold 14px "Open Sans", "Arial Unicode MS", "sans-serif"',
@ -325,8 +325,7 @@ const styles = {
}); });
}, memoizeOptions), }, memoizeOptions),
}, },
MultiLineString: {}, poi: {
Point: {
getParameters: (feature: Feature) => { getParameters: (feature: Feature) => {
const klass: string = feature.get('class'); const klass: string = feature.get('class');
const isHighlighted = highlight.hasOwnProperty(klass); const isHighlighted = highlight.hasOwnProperty(klass);
@ -375,8 +374,6 @@ const styles = {
}, },
}; };
styles.MultiLineString = styles.LineString;
export const style = (feature: Feature, resolution: number) => { export const style = (feature: Feature, resolution: number) => {
const type = ( const type = (
feature.get('type') !== undefined ? feature.get('type') : feature.type_ feature.get('type') !== undefined ? feature.get('type') : feature.type_

View File

@ -236,7 +236,7 @@ const Map: Component = () => {
}); });
const vectorTileSource1 = new VectorTileSource({ const vectorTileSource1 = new VectorTileSource({
format: new MVT(), format: new MVT({ featureClass: Feature }),
url: 'https://geo.dyomedea.com/services/spain/tiles/{z}/{x}/{y}.pbf', url: 'https://geo.dyomedea.com/services/spain/tiles/{z}/{x}/{y}.pbf',
maxZoom: 14, maxZoom: 14,
}); });