hi,
i got a marker points and attributes that i store on MongoDB, i use MEAN to create this web. But i got a problem when i want to edit my data.
How do i edit data on that popup? Or is there any others way to edit when i click the marker point?
Thanks
Solved! Go to Solution.
You can customize the PopupTemplate however you want.
Get started with PopupTemplate | ArcGIS API for JavaScript 4.0
You can also define custom actions for the Popup.
The JS API doesn't provide specific editing support for external services/db like MongoDB. 4.0 doesn't have editing currently, but even in 3.x you can only edit FeatureServices.
In both 3.x and 4.x you'll need to create a custom interface to edit your MongDB data.
In 3.x, you'll want to do something similar to this sample.
ArcGIS API for JavaScript Sandbox
Where you can move the points, updating the coordinates and then you will need to publish those updates back to your service via a CRUD API of your own.
Thank you Rene Rubalcava for the answer.
Okay. So is there a way to retrive data on the marker that i click?
I want to get data attribute and put it on my input field on the right bottom div.
Thank You.
You can use the "click" event of the View and "view.hitTest()" as shown here.
Thank you again Rene Rubalcava
I want to ask more.
From the first image. It got a popup when i click on the points. In place of email and phone number, i want to show a "Click to show email" and "Click to show phone" to avoid bot. Is there any method to do this?
//Update
i tried jQuery. but i think jQuery doesnt work on Popup? because i try to add class to the div and console log but nothing happened.
You can customize the PopupTemplate however you want.
Get started with PopupTemplate | ArcGIS API for JavaScript 4.0
You can also define custom actions for the Popup.