Select to view content in your preferred language

In the drag and drop CSV example, what gives the image it's position?

2477
3
Jump to solution
10-14-2015 10:10 AM
TracySchloss
Honored Contributor

In the example Drag and drop to display data | ArcGIS API for JavaScript it says you can also upload images.  How do you control the position of the image?  Is it based on the mouse position when you drag it onto the map canvas?  It seems like this would only work for one image.

0 Kudos
1 Solution

Accepted Solutions
TimWitt2
MVP Alum

Tracy,

wherever your mouse cursor is when you drop the image, that is where the image will be.

  if (file.type.indexOf("image/") !== -1) {
          handleImage(file, event.layerX, event.layerY);
        }
        else if

Tim

View solution in original post

3 Replies
TimWitt2
MVP Alum

Tracy,

wherever your mouse cursor is when you drop the image, that is where the image will be.

  if (file.type.indexOf("image/") !== -1) {
          handleImage(file, event.layerX, event.layerY);
        }
        else if

Tim

TracySchloss
Honored Contributor

I guess that makes sense technically, but to me its a rather nonsensical bit of functionality.  I guess you could write additional code that lets people pick it up and move it until it was where they wanted it. 

0 Kudos
TimWitt2
MVP Alum

Yeah, I don't know why this has been added, other than to show it is possible?

0 Kudos