Find grid selection of point feature zoom too much
Closed this issue · 9 comments
I am getting more and more interested in cmv. It is really wonderful so thank you all cmv team.
The question is how to zoom just a little or non or to a specific zoom level when selecting a point feature from the grid table populated by find widget results You see currently map is zoomed to very highest level around that point.
@mtabdar I think I am currently trying to do the same thing. So for example I want to provide a unique URL to a Client which will bring them to a point on a map such as in this example here:
http://bhgis.org/apeg/sites/index.html?center=-9138449.30073,4832424.35297&level=15
(Bare with me all this was a FLEX based application I created a few years ago.) This unique URL will take the Client to property that can be viewed by potential new owners. The question is how do you mimic this in the JS based applications?
There is the option to add a History API to Track Selected Features function, but I am not exactly sure that this will accomplish the task I am looking for.
Looking over the following reference info I want to believe its much more simple than this.
@mtabdar I am first curious is this the issue you are trying to solve (If not I will create a separate issue). And second curious if anyone can provide any insight as to how this task can be achieved.
It seems to me you're asking different things.
-
@mtabdar, I think you're asking about the attributes table this widget here? It looks like the widget zooms to the extent of the feature, so if its a point, by default it will zoom to the max. Not sure if this behavior is easy to change or not, but it doesn't look like its a configureable option at the moment.
-
@drusexton you're asking about setting default zoom levels when the app initializes based on url parameters. I'd recommend a simple mixin. The new cmv lets you drop in mixins that could modify the config object before the app loads. Something like this would work:
https://gist.github.com/roemhildtg/b0a818140676ec7da60aaa52519585e7
Note, to use the mixin you'd need the 2.0 version of cmv!
@drusexton Perhaps this Navigation Hash
widget would work for you? https://github.com/BrianBunker/cmv-widgets/tree/master//MapNavigationHash
@mtabdar If you asking about the Find widget, you can use a larger pointExtentSize
parameter to control how the widget zooms to a point. This is in units for the map's spatial reference. For an app that uses the Web Mercator projection, the default is an extent of 25 meters around the point.
You can use the same pointExtentSize
parameter for any searches within the Search widget (that widget uses the AttributesTable widget that @roemhildtg mentioned). The default for that search widget is an extent of 250 meters around the point.
@roemhildtg Actually the primary public URL will show the full extent of a property inventory, which has 500+ properties in it. I also have separate pages in another website that will include information related to each property. On these pages I want to have link to the property that will bring the client to my CMV application but direct them to the specific property location.
@tmcgee this widget is close, and I might be able to use it to acquire the unique URL I am searching for. I think if I can utilize the framework of this widget add a few fields to the attributes table in ArcMap and use the Calculate Geometry tool to acquire the lat/long values I will need. I will then be able to use the Field Calculator to generate a field unique URL for each site. Therefore I think this will work. If not I will create a new thread.
@mtabdar Sorry for hijacking your thread...
Hi thank you all for different responses. I think pointExtentSize mentioned by tncgee would be a good point for me to try.
@drusexton don't mention it we are all trying to learn something and in fact i liked your question and of course tmcgee's response. It may come handy some time.
@mtabdar I can't tell for sure where you made changes so please ignore me if I'm misinterpreting...
From an overall perspective, do not make changes to the widgets themselves unless absolutely necessary. That will make future upgrades much easier for you. In this case, the right thing to do is add pointExtentSize: 25000
, in the configuration file here
Good point! You are right changing config file is much better.
And again you are right i applied your instruction and i got what i wanted. Thanks