Hi, Is anyone able to fire the event with view.emit because what ever I tried I'm not able to fire the event programmatically. Can anyone be specific about the solution?Thanks,
Sai Anand Peketi
Well shoot...I just figured that out:
mapView.popup.open({ location: event.result.feature.geometry, // <- use map point of the click event fetchFeatures: true // <- fetch the selected features (if any) });
It still would be nice to fire the click event though...
Hi...any luck on this? No matter what I try I can't seem to get the click to fire. The mapview.emit does not seem to work in this case. I am trying to get a forced map click to run an identify programatically.
Thanks.
I don't know the answer to that. Since it's off-topic, you might consider posting it as a separate question for greater visibility.
Thanks, it's a good idea。
If you use sketchViewModel API to draw polygons, can you click the button to punctuate with emit. How can this be achieved?
Technically, you'd be able to do this by calling MapView.emit, and passing as close to an event object as you can. This could be problematic though, since simulating the "stopPropagation" function and the "native" property could present certain inconsistencies.
Probably the easiest approach would be something like this:
function simulateClick(mapView, mapPoint) { var screenPoint = mapView.toScreen(mapPoint); mapView.emit("click", { mapPoint: mapPoint, x: screenPoint.x, y: screenPoint.y, button: 0, buttons: 0, type: "click", stopPropagation: function() { }, timestamp: Date.now(), native: {} }); }
As a disclaimer, I would never do this in practice, or recommend it either...I'm just answering the question as asked.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.