Last week we finally released v1.0 RTW of our Silverlight/WPF API. Today at our User Conference in San Diego, Jack Dangermond announced, that it even will be free for non-commercial use. The API will run on both v2 and v3 of Silverlight. [. . .] Read more
Where I BLOG about the things I like! IT, GIS, Army National Guard, and hopefully fishing again one day.
Sunday, September 6, 2009
ArcGIS Javascript API query only returning max 500 features?
Sunday, August 23, 2009
Why upgrading to ArcGIS 9.3.1 could take so long.
Monday, July 13, 2009
ArcGIS API for Silverlight no longer in BETA!
ESRI ArcGIS Silverlight/WPF API releasedBy Morten (7/13/2009 4:25:00 PM)
Saturday, June 27, 2009
Wonder how ArcGIS Javascript API examples work so well in IE8
<meta http-equiv="X-UA-Compatible" content="IE=7" />
Well, for those of you who don't know, this forces IE8 to go into compatibility mode, and actually view the page as if it were IE7.
So the moral of this blog is, if you want to upgrade to ArcGIS Javascript API 1.4 and have users visit your site using IE 8, you are going to have to force IE8 browsers into IE7 compatibility mode.
Thursday, June 18, 2009
Louisiana - West Baton Rouge Parish Preliminary Digital Flood Rate Insurance Map (DFIRM) now published
Thursday, June 11, 2009
Adding a 3rd party WMS map service using ArcGIS Javascript API
Well, I've looked all over for how to add a WMS to a website using the ArcGIS JavaScript API. ESRI’s resources web site offered a clue by showing how to add a WMS service generated from a ArcGIS Server to a map, but it did not quite work with other WMS Services.
Since I didn’t have much luck there, or elsewhere on the web, I figured I would teach myself. Furthermore, I figured I would document it along the way so that someone else who tried this in the future might have better luck. Before you get started however, I highly recommend you at least glance at the OGC Web Map Services standards, I have even provided you with a link toVersion 1.1.1here which is the version of the WMS that I use in this example.
So, here it goes:
I wanted to have access to the current rain/weather situation in my website, so I chose theCONUS NEXRAD Base Reflectivity (N0R) WMS layer, hosted by Iowa Environmental Mesonet, and I overlayed it onto an existing base map that I have. Doesn't seem like it would be that complicated right? Well if you are left just to ESRI’s web resources and don’t know much about WMS standards it just may be.
The first step is to create a WMS Layer as a ArcGIS DynamicMapServiceLayer usingdojo.declare which requires 3 arguments as follows:
1. The name of the Class that you wish to declare which is a string representation of the name. I will use “my.WeatherRadarWMS”
2. The next parameter is either an object or an array of objects. In this case it is the ESRI ArcGIS JavaScript API defined object DynamicMapServiceLayer.
3. The third parameter is an JSON object hash of properties to be mixed in after all other inheritance has been solved. This instance has two properties constructor and getImageUrlwhich are required.
// Save time by declaring your start extent up front
// this is the full extent for the state of Louisiana
var startExtent = new esri.geometry.Extent({ xmin: -94.647329960938, ymin: 28.1275820820308, xmax: -88.154410039062, ymax: 33.7470889179692, spatialReference: new esri.SpatialReference({wkid: 4269})});//Create the WMS layer
declare("my.WeatherRadarWMS", sri.layers.DynamicMapServiceLayer, {
// Now for the constructor definition
constructor: function() {
this.initialExtent = this.fullExtent = startExtent;
this.spatialReference = new esri.SpatialReference({wkid:4269});
this.loaded = true;
this.onLoad(this);
},getImageUrl: function(extent, width, height, callback) {
//***** PAY ATTENTION HERE ******************//
//* The ESRI Example uses a JSON Object which works
//* fine with an ESRIgenerated WMS, but not with
//* WMS’es created by other software. I had change
//* the parameters to a string this section up a bit.
//**********************************************//
var params =
"VERSION=" + "1.1.1" +
"&REQUEST=" + "GetMap" +
"&SRS=EPSG:" + "4326" + // You need to use the WMS’s spatial wkid
"&width=" + width +
"&height=" + height +
"&LAYERS=" + "nexrad-n0r,nexrad-n0r-900913,
nexrad-n0r-m10m,nexrad-n0r-m15m" +
"&STYLES=" +
"&FORMAT=" + "image/png" +
"&TRANSPARENT=" + "true" +
"&bbox=" + extent.xmin + "," + extent.ymin + "," + extent.xmax + "," + extent.ymax
"&exceptions=" + "application/vnd.ogc.se_xml"callback("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?" + params );
}
})
}
Now all that’s left is to add the layer to your map document as follows:
//Add WMS Weather Layer
map.addLayer(new my.WeatherRadarWMS());//or ......
//If you wanted to add opacity to the layer,
// you could do this
wmsRadarLayer = new my.WeatherRadarWMS()
wmsRadayLayer.setOpacity(.75)
map.addLayer(wmsRadarLayer)
And there you have it, a WMS layer added via ArcGIS JavaScript API. You can see a live version of this here. I will leave it up for a bit.
Post a comment if you find this helpful or if you have any questions.
Monday, June 8, 2009
ArcGIS JavaScript API 1.4 released, and some functions no longer work the same in IE8.
While I was able to resolve most of my issues when ArcGIS JavaScript API 1.3 was released, I am back to the grinding wheel with the latest release of ArcGIS JavaScript API 1.4 . I have once again found more problems that I have to address or work-around with ESRI's latest release of their JavaScript API.
One of the first problems I noticed, is that when using shift+click+drag to draw a zoom rectangle, the oncle slick zoom rectangle no longer appears although the function still appears to work. If you look at their sample posted here, you will notice that they no longer list the zoom function.
If you have IE 8, you can view this test page that I built here which is using ArcGIS JavaScript API version 1.4. If you have FF, take a look and use the zoom function and you will see that the zoom function does not draw correctly. Both of these problems do not exist in version 1.3.