ghettovoice / vuelayers

Web map Vue components with the power of OpenLayers
https://vuelayers.github.io/
MIT License
682 stars 230 forks source link

Feature properties is undefined #463

Closed malkovDanik closed 2 years ago

malkovDanik commented 2 years ago

Hello, Vladimir! I created demo https://jsfiddle.net/DanikJsFiddle/0a2qsh5g/67/ with my problem.

I create <vl-interaction-select>. I use <template slot-scope="selectScope"> into <vl-interaction-select> to create overlay popup. Further, feature properties are changed by method's overlay . Now, I want to see modified props in deselect method of interaction, but they equals undefined.

ghettovoice commented 2 years ago

Hello @malkovDanik , first of all you can't change feature properties inside v-for of select scope, and actually it isn't supposed. JSON features here are just a dump of internal openlayers objects. So they are read-only.

You can make any changes in select/unselect event handlers. However take a note how I have made it in a new demo https://jsfiddle.net/ghettovoice/xaofqhdc/9/. Event object contains several fields:

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.