Showing Last clicked locaiton

3481
3
Jump to solution
04-20-2015 12:53 PM
RickeyFight
MVP Regular Contributor

I want a user to know where they clicked last on a map.

I am looking for a way to add a point symbol and remove the old one when a map is clicked.

I am using this: Add graphics to a map | ArcGIS API for JavaScript  sample.

I can add a point but I have to click on the add point button in the tool bar.

I am thinking Like this: SoilWeb: An Online Soil Survey Browser | California Soil Resource Lab but with Esri API not google.

Thank you

0 Kudos
1 Solution

Accepted Solutions
SteveCole
Frequent Contributor

Here's a simple Fiddle showing you the essential code to do this. You just need to tie into the map's click event and then add your graphic in that event handler's function.

Steve

View solution in original post

3 Replies
SteveCole
Frequent Contributor

Here's a simple Fiddle showing you the essential code to do this. You just need to tie into the map's click event and then add your graphic in that event handler's function.

Steve

RickeyFight
MVP Regular Contributor

Steve,

Your fiddle does not seem to be working, I got to code you provided to work though!

Thank you!

0 Kudos
SteveCole
Frequent Contributor

Rickey,

That's weird. It works when I'm logged into JSFiddle but not when I'm logged out. Oh well. Glad the code helped you, though!

0 Kudos