Moving vector tile layer's MVT to Feature (instead of RenederdFeature) to prepare for clustering.
This commit is contained in:
parent
4917d27c9c
commit
12466d214c
|
@ -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_
|
||||||
|
|
|
@ -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,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue