ArcGIS
Oakland County Launches Golf and Trails
Today Oakland County launched Golf and Trails, or GAT, their first ArcGIS Server Web Application based on the JavaScript API.
Over the past 2 years I, as a consultant via Technology Aces, have been part of a team of developers working on a very large GIS web application. So large and so complex that its first public appearance is as the underlying framework that powers GAT.
I am happy to say that one of my projects with Oakland County finally released to the public, even if it is a “light” version.
Dojo and ASP.NET AJAX Compatibility
As part of developing a project I created a Cross-Domain Proxy to consume the payment service. My Cross-Domain Proxy, Payment.asmx, is exposed via the JavaScript end point. Any ASP.NET web service can open the JavaScript endpoint by uncommenting line #7 in the asmx file.
Once the ScriptService line is uncommented you can test that your service is exposing the JavaScript endpoint by calling a URL similar to:
1: ~/WebService.asmx/JS
In the master page I pull the service in.
1: <asp:ScriptManager ID="ocScriptManager" runat="server">
2: <Services>
3: <asp:ServiceReference Path="~/WebServices/Payment.asmx" />
4: </Services>
5: </asp:ScriptManager>
At this point everything works. I can write JavaScript to call back to the web service methods as such:
1: WebService.AddItem('item', CallBackFunction, FailFunction);
2:
3: CallBackFunction = function(){
4: alert('everything worked');
5: }
Now, I pull dojo into this project.
1: <script type="text/javascript">djConfig = { parseOnLoad: false, usePlainJson: true };</script>
2: <script type="text/javascript" src="http://dojopath/dojo.js"></script>
Here is where we start to run into problems. Due to, what I believe, is having both JavaScript APIs in the same project.
If we change the order of API loading we can get a, somewhat, clearer error message.
Now looking at line 1175 we see:
Conclusion:
I believe that I have exhausted my troubleshooting efforts. although I am not sure if this is enough information to validate the existence of a bug I opened a ticket with Dojo. Then again, I am not sure who can or should fix it.
http://trac.dojotoolkit.org/ticket/7353
I blogged about this once before.
http://eric.polerecky.com/archives/dijitformvalidationtextbox-and-aspnet-ajax/
Workaround:
In my project I use dojo.xhr to make calls back to the server.
Twitter Map Mashup
I did a search the other day for the a new blog post I saw fly by on Twitter about the top 100 twitter applications and ended up re-reading a post from RRW about the top 10 twitter applications. Now the post is from 2007, so I am sure that the top 10 has changed quite a bit. What I took away from the article was a note about Twitter Atlas.
What’s it missing? The ability to get only your Twitter group’s tweets shown on the map.
First thought: really, that’s so silly there has to be a fun little mashup for that…and I on went to check out the top 100. Once there I pulled up all the map based apps…could not find anything that displayed, in easy fashion, the people you follow.
So, 4 hours later…damn I hate CSS…I need someone to do all my CSS work for me…its just not the part of coding that I like. Anyway, so I coded a mashup. You can guess what it does. Pop in a user, click and get the people they follow on a map. Then you can click on anyone they follow and do the same…its kinda fun and I waste a lot of time getting list in the network.
Downside, the twitter API requires auth to pull the total users..so I can’t tell how many people someone is follow, so I can’t figure out how many pages I need to request to get everyone. I only do one request.
Can anyone suggest a name?
Check it my twitter map mashup and let me know what you think…thanks!
Oh, anyone from ESRI..can I use your basemap data? I’d really like to redo this in the ArcGIS Server JS API….I think…
UPDATE: Crap its LATE!, I added a breadcrumb ..I think it encourages one to keep diving into the network. Which is really cool but without caching there is a huge number of requests to the google geocode service…yuck.. Next task…caching of markers…Late next week after I do some real client work…
I just can help myself
My good friend Jamey’s first blog post is about helping himself. Well…I just did the same on a post about using the ESRI JavaScript API to zoom to a polygon so I thought it best to provide him with a ping back…
Poor DOM manipulation in Dojo
In jQuery DOM manipulation is incredibly easy:
$("#dealer-toggle").toggle();
One would assume the same can be accomplished in dojo via:
dojo.query('node').toggle();
but you would be DAMN WRONG!
dojo.query will work fine but hide/show/toggle have been moved to the dojo.fx and renamed fadeOut for .hide() and wipeIn for .show()…what about toggle? no sir. There is no dojo function to toggle nods. You have to write your own.
ESRI
For anyone using the ESRI JavaScript Library for ArcGIS Server (a JavaScript Lib based on Dojo): ESRI created their own namespace in the API.
The ESRI namespace consists of 7 methods. I bet you can guess 3 of them.
hide
show
and of course
toggle
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jsapi/namespace_esri.htm
Wish
- Dojo “fixes” their query interface by using common function names. even if they are alias.
- Dojo adds toggle to the functions that can be acted on node lists (a node list if what is returned from dojo.query)
- The ESRI namespace used the same constructors as Dojo. ie: hide should be dojo.query(‘node’).hide();
ArcGIS Server 9.3, REST and Cache
After publishing a service if you make changes to the .MXD you need to clear the REST cache. There are a few ways to clear the REST cache:
- Restart IIS – Super Easy
- From the ArcGIS 9.3 REST admin page
- The Admin page is located at: http://xxxxxxxxxx/ArcGIS/rest/admin/
Until you restart IIS the updates to the MXD will not be reflected in the REST service endpoint.
