0

I've been digging through the ArcGIS map trying to figure out how to find the size of the map. The map object has width / height but those are the containing div and not the width / height of the current map. Is there a way to find / calculate the width / height of the map?

0

using Spatial Reference of 4326 (GPS coords)

I was able to find the width of the map using

var left = new Point(-180, 0)
  var right = new Point(180, 0)

  var leftScreenPoint = map.toScreen(left); //ScreenUtils.toScreenPoint(map.extent, map.width, map.height, left);
  var rightScreenPoint = map.toScreen(right);

basically I get the screen point for the far left, and screen point for the far right and then subtract right from left to get the map width

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.