Still working on the cluster proxy
This commit is contained in:
parent
6f359b2e80
commit
c70e7baa4b
|
@ -309,7 +309,7 @@ const styles = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getStyle: memoize((params: any) => {
|
getStyle: memoize((params: any) => {
|
||||||
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.way.strokes[network],
|
stroke: styles.way.strokes[network],
|
||||||
|
@ -335,11 +335,12 @@ const styles = {
|
||||||
klass,
|
klass,
|
||||||
isHighlighted,
|
isHighlighted,
|
||||||
isTextHidden: zoom() < 19,
|
isTextHidden: zoom() < 19,
|
||||||
isHidden: !isHighlighted && zoom() < 16,
|
// isHidden: !isHighlighted && zoom() < 16,
|
||||||
|
isHidden: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getStyle: memoize((params: any) => {
|
getStyle: memoize((params: any) => {
|
||||||
console.log({ caller: 'getStyle', params });
|
// console.log({ caller: 'getStyle', params });
|
||||||
const { isSelected, name, klass, isHidden, isTextHidden, isHighlighted } =
|
const { isSelected, name, klass, isHidden, isTextHidden, isHighlighted } =
|
||||||
params;
|
params;
|
||||||
if (isHidden) {
|
if (isHidden) {
|
||||||
|
@ -385,9 +386,12 @@ export const style = (feature: Feature, resolution: number) => {
|
||||||
return createDefaultStyle(feature, resolution)[0];
|
return createDefaultStyle(feature, resolution)[0];
|
||||||
}
|
}
|
||||||
const params = styles[type].getParameters(feature);
|
const params = styles[type].getParameters(feature);
|
||||||
|
if (params?.isHidden) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const getStyle = styles[type].getStyle;
|
const getStyle = styles[type].getStyle;
|
||||||
const style = getStyle(params);
|
const style = getStyle(params);
|
||||||
console.log({ caller: 'style', feature, type, params, style });
|
// console.log({ caller: 'style', feature, type, params, style });
|
||||||
if (style === undefined) {
|
if (style === undefined) {
|
||||||
return createDefaultStyle(feature, resolution)[0];
|
return createDefaultStyle(feature, resolution)[0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,7 +374,7 @@ const Map: Component = () => {
|
||||||
|
|
||||||
const vectorTileLayer = new VectorTileLayer({
|
const vectorTileLayer = new VectorTileLayer({
|
||||||
source: vectorTileSource,
|
source: vectorTileSource,
|
||||||
style: [],
|
style,
|
||||||
declutter: false,
|
declutter: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -67,15 +67,15 @@ const overloads = {
|
||||||
}
|
}
|
||||||
props.featuresSent = false;
|
props.featuresSent = false;
|
||||||
setProps(target, props);
|
setProps(target, props);
|
||||||
console.log({
|
// console.log({
|
||||||
caller: 'clusterableVectorTileSourceProxy',
|
// caller: 'clusterableVectorTileSourceProxy',
|
||||||
overload: 'loadFeatures',
|
// overload: 'loadFeatures',
|
||||||
extent,
|
// extent,
|
||||||
resolution,
|
// resolution,
|
||||||
projection,
|
// projection,
|
||||||
target: target,
|
// target: target,
|
||||||
props,
|
// props,
|
||||||
});
|
// });
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -90,13 +90,13 @@ const overloads = {
|
||||||
//console.trace();
|
//console.trace();
|
||||||
props.featuresSent = true;
|
props.featuresSent = true;
|
||||||
setProps(target, props);
|
setProps(target, props);
|
||||||
console.log({
|
// console.log({
|
||||||
caller: 'clusterableVectorTileSourceProxy',
|
// caller: 'clusterableVectorTileSourceProxy',
|
||||||
overload: 'getFeatures',
|
// overload: 'getFeatures',
|
||||||
result,
|
// result,
|
||||||
props,
|
// props,
|
||||||
target,
|
// target,
|
||||||
});
|
// });
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue