URL parameters zoom level

739
4
Jump to solution
04-11-2019 10:43 AM
ScottThomas1
New Contributor III

I'm using URL parameters to select to a polygon on open but the zoom level is usually 1 level to close. Is there an easy way to back it off?

WAB Dev. 2.11

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Scott,

The only way you can fix this is to modify the MapUrlParamsHandler.js file selectFeatures method. Where it does the map.setExtent.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Scott,

The only way you can fix this is to modify the MapUrlParamsHandler.js file selectFeatures method. Where it does the map.setExtent.

ScottThomas1
New Contributor III

I see that around line 400 but it isn't clear how to make an adjustment. I was hoping it was a simple zoom level but it looks like the extent sets a minx & y etc.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Scott,

   You just use the extent classes expand method. i.e.

map.setExtent(resultExtent.expand(1.2, true));

ScottThomas1
New Contributor III

That worked great. I pushed it out a little more even. As a mapper dabbling in code, I really appreciate the help you offer here.

0 Kudos