Merge pull request #9979 from mfo/US/fix-point-input
ETQ usager: fix comportement des marqueurs de la carte dans les blocs répétables
This commit is contained in:
commit
c4bdef3a1c
2 changed files with 12 additions and 5 deletions
|
@ -147,16 +147,20 @@ function useExternalEvents(
|
||||||
|
|
||||||
const onFeatureCreate = useCallback(
|
const onFeatureCreate = useCallback(
|
||||||
({ detail }) => {
|
({ detail }) => {
|
||||||
const { geometry, properties } = detail;
|
const { feature } = detail;
|
||||||
|
const { geometry, properties } = feature;
|
||||||
if (geometry) {
|
if (
|
||||||
|
feature &&
|
||||||
|
feature.geometry &&
|
||||||
|
detail.featureCollection == featureCollection
|
||||||
|
) {
|
||||||
createFeatures({
|
createFeatures({
|
||||||
features: [{ type: 'Feature', geometry, properties }],
|
features: [{ type: 'Feature', geometry, properties }],
|
||||||
external: true
|
external: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[createFeatures]
|
[createFeatures, featureCollection]
|
||||||
);
|
);
|
||||||
|
|
||||||
const onFeatureUpdate = useCallback(
|
const onFeatureUpdate = useCallback(
|
||||||
|
|
|
@ -23,7 +23,10 @@ export function PointInput({
|
||||||
};
|
};
|
||||||
const addPoint = () => {
|
const addPoint = () => {
|
||||||
if (feature) {
|
if (feature) {
|
||||||
fire(document, 'map:feature:create', feature);
|
fire(document, 'map:feature:create', {
|
||||||
|
feature,
|
||||||
|
featureCollection
|
||||||
|
});
|
||||||
setValue('');
|
setValue('');
|
||||||
setFeature(null);
|
setFeature(null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue