Select to view content in your preferred language

vertices move offset when page is scaled with css transform

649
1
11-16-2016 09:35 AM
CalvinShi
New Contributor

I have a map on a div, and I scale up the div by 2 using css transform scale(). now my issue is that when i dragging vertices to change the shape of polygon, it is offset from my mouse point. I don't know if there is a way that i can fix it.

an example of my issue would be https://developers.arcgis.com/javascript/3/samples/toolbar_edit/and add transform-origin: top left; transform:scale(2); to mainWindow div.

any advice and suggestions will be greatly appreciated

0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

This usually happens when the map isn't resized after map is loaded. Search on GeoNet and you'll see many instances of a mouse offset.

Try putting this in your code

 map.on("load", function(){
   map.resize();     
});  
0 Kudos