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