How i get event in geocoder?

i want to have geometry of features i select in geocode results, actually i want to highlight selected feature by geometry (use polygon) plz tell me how ? thanks, sorry my english very bad :frowning:

@yenph

No need to apologize! Our community will still try to help you as much as possible :grinning: Does this sandcastle demo resemble what you are looking for?

If not, can you find another sandcastle demo or example of what you have in mind? I am looking forward to learning more.

-Sam

1 Like

thank you for your hard support! :grinning: but i have another question, viewer.geocoder.viewModel.destinationFound = function flyToDestination(viewModel, toado) { console.log("He", toado); // copy code zoom to console.log("He", toado[0][0]); viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees( toado[0][0], toado[0][1], 50, ), }); var redPolygon = viewer.entities.add({ polygon: { hierarchy: Cesium.Cartesian3.fromDegreesArray(toado.flat()), material: Cesium.Color.ORANGE.withAlpha(0.5), }, }); };
i want to remove older polygon when i create a new polygon from toado, can you help me?

@yenph

I recommend setting the variable to undefined. Please give this a try and get back to me!

-Sam