Select to view content in your preferred language

Dojo zoom  Dijit - simple question

1082
8
01-13-2011 07:15 AM
AdrianMarsden
Honored Contributor
Hi

I'm looking at the excellent example here - http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2009/05/29/An-easier-way-to-zoom_3A00_-A-Dojo-d...

and have what is probably a numpty question - how do i create my own JSON files for areas I want to create a zoom list to?

Cheers
ACM
0 Kudos
8 Replies
derekswingley1
Deactivated User
That's completely up to you. When I originally wrote the dijit, I used some python to read the county and state geometries, grab the extents and write a .json file that could be used easily by a dojo data store. Take a look at the county and state .json files provided in the sample and you'll be able to see the structure.

You should also take a look at another blog post:  Custom Objects in dojo.ItemFileReadStore: Using a Type Map.
0 Kudos
AdrianMarsden
Honored Contributor
cool, as long as I wasn't missing the big red "make shapefile to JSON" button somewhere.

In fact, whilst at home watching an episode of Buffy, I realized how to do it.  I have FME, which creates full fat JSON files, with the full geometry in.  But I realized if I take yours, convert it, say to a dbf, in FME, see the structure, then make a similar one with the areas I want in, FME should then convert that back to a JSON with just what I want - i think:D  Who knows, but I think I can see the light (as it were)

Many thanks

ACM
0 Kudos
derekswingley1
Deactivated User
No problem. You could also paste some of the json in a site like JS Beautifier or JSON Visualization to get an idea of the structure of each JSON file.
0 Kudos
AdrianMarsden
Honored Contributor
FME 2011 came my way today,with a new format ESRIJSON - one output geometry is "rectangle" running the shapefile with my towns though the "bounds extractor" and to an ESRIJSON format with rectangle geometries, more or less got what I want in one hit.

I need to test it & stuff but it looks perfect 😄
0 Kudos
derekswingley1
Deactivated User
Nice! I'm not an FME user but that sounds like exactly what you need.
0 Kudos
AdrianMarsden
Honored Contributor
one final question - is the packaged example still around for download - the link on the blog is broken - obviously I can get all the files one at a time.....;)
0 Kudos
derekswingley1
Deactivated User
Since the old resource center was retired, I'm not sure where you can download this anymore. I'm planning to update and post on arcgis.com. Until then, I've attached the file that was previously available on the resource center.
0 Kudos
AdrianMarsden
Honored Contributor
Many thanks for that - I have it all nicely integrated in my site now - however, I have been using the "compact" version of the API - mainly as the zoom buttons are nice and clear (the default ones just vanish, and I haven't had time to work out how to customize them)

In the past I've been able to work out which bits I needed to include by name when using the compact version, but I can't work it out this time.  Any ideas?

Cheers

ACM

Edit - not so important now - I've reverted to full version and changed the slider - still work in progress as I need to tidy up the code a bit http://maps.eastdevon.gov.uk/mapping/shlaa/
0 Kudos