Select to view content in your preferred language

Map extent and screen size

1997
2
Jump to solution
08-04-2014 03:03 AM
RahulMetangale2
New Contributor II

Hi All,

I want to know if map extent and screen size are related.

My observation:

I have developed a JavaScript web application. This application has side panel. When panel opens I shift the map rather than adding a overlay. I have defined extent (WKID 102100)  in application configuration file. When I run the application on iPad in landscape and portrait mode and click on the default extent (this is nothing but I read the extent from config file and call map.setExtent(extent_from_Config) ) i observe that map zooms out a little. Hence i think extent and scree size are related.

Please let me know if this is expected behavior. Also any material you can provide to clear related concept would be helpful

Regards,

Rahul

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
OwenEarley
Regular Contributor

Hi Rahul,

If you resize the map to make room for your side panel then the map dimensions change (in this case the width). This will trigger a resize and a change to the map extent. If the side panel is showing when you apply your default extent using map.setExtent(), the map is forced to zoom out a little to fit the default extent within the map frame.

If you are using a tiled base map you could get around this issue by using a default map center and zoom level.

Owen

View solution in original post

0 Kudos
2 Replies
OwenEarley
Regular Contributor

Hi Rahul,

If you resize the map to make room for your side panel then the map dimensions change (in this case the width). This will trigger a resize and a change to the map extent. If the side panel is showing when you apply your default extent using map.setExtent(), the map is forced to zoom out a little to fit the default extent within the map frame.

If you are using a tiled base map you could get around this issue by using a default map center and zoom level.

Owen

0 Kudos
RahulMetangale2
New Contributor II

Thank you Owen!

0 Kudos