If you create web-based GIS websites without using the browser plug-in that provides ECWP ability you need to be aware of something very important.
All modern web browsers impose a security restriction that prevents a script or application from making a connection to any web server other than the one the web page originally came from.
So, if your JavaScript file comes from http://iws.erdas.com/ it can only talk to resources from http://iws.erdas.com/.
It cannot access resources from another domain like http://www.yahoo.com/ or even http://www.erdas.com/ .
This can present a challenge when we use a purely HTML and JavaScript front-end to imagery or GIS data. We may have these resources on different servers and domains. For example, I might serve my web page (html, JavaScript, etc) and imagery from one server, but my GIS information from a different server. Given the above limitation, this isn't available by using just a browser. So, how do we get around this.
To be able to request data from a source apart from the scripts orginating domain, we use "server-side proxys". These server-side applications reside on the domain that the javascript is served from....
If you are wondering how to create a website using Optimized Tile Delivery, or OTD, I have some very good news for you.
OTD sites are created using the same website API that are used to create other Image Web Server sites. It is exactly the same as when you are creating DHTML sites, and only marginally different from creating ECWP high-speed streaming sites.
The only real difference is that the file you are passing is a .OTDF file.
So, to create your OTD enabled site, you just need to force the page to use the DHTML control, by setting the correct browser cookie:
setCookie("NCSPluginInstallMethod", "HTML"); |
If you are using the "NCSCreateView" function, that is all you need to do.
If you construct the map control directly, you would need to make sure that you instantiate the NCSJSView, for example:
Once again, Chris Tapley has been busy, and has developed some simple ways to add IWS data to ArcGIS based websites.
The integration is in two parts: - ArcGIS WebADF ImageX/OTDF DataSource
- ECWP and ImageX/OTDF layers for the ArcGIS REST JavaScript API
The “ArcGIS WebADF ImageX/OTDF DataSource” requires the following to be installed on the machine: - ArcGIS Server 9.3 .NET edition
- Microsoft Visual Studio 2005
It is possible to just deploy the Web Mapping Application to an ArcGIS server machine without VS2005 installed, but for development purposes VS2005 needs to be there....
OpenLayers is an extremely popular framework for creating web-browser based mapping applications.
A developer in our Perth, Australia office, Chris Tapley, has created a "ECWP Layer Type" for OpenLayers. So, if you are using, or want to use, OpenLayers, you can now easily add an ECWP layer.
An example of this can be found at: http://iws.erdas.com/OpenLayers_and_iws.htm
If you want to create your own OpenLayers / ECWP enabled maps you can download the code: openlayers_and_iws.zip....
"Minification" is the process of removing unnecessary white space and comments from javascript files. This can have the result of reducing the site of the javascript by 30%.
I use the following online service to minify the javascript on this site: http://www.vlead.in/resources/tools/minify-javascript/
You might find it useful too......
When you deploy your web mapping application, you want it to run as fast as possible. There are a number of "tricks" you can use to make it even faster. Many of these tricks seem to be missed when people deploy websites (GIS based or otherwise). HTTP compression. This can really shrink the size of your HTML, Javascript or CSS files. usually to about 20% of what they were originally. With GIS Mapping sites, there is usually quite a bit of logic going into the JavaScript end - so making your JavaScript files as small as possible is a real benefit. For example - iws.js - one of the main JavaScript files went from 140KB to just 29KB! Minification of JavaScripts, CSS and HTML. Minification indicate the removal of excess or unnecessary whitespace or comments in your JavaScript or CSS files. Cutting out this space can reduce the size of a text based file by around 30%. With this size, I also strip out excess whitespace in the HTML files.
Minification often extends to renaming variables in JavaScript files to "shorter names", saving on size of data. I have had mixed success with this - sometimes it seems to create errors in my code. Combine CSS and Javascript files. Reducing the number of individual requests for files speeds up data access. So, where possible I have grouped CSS and Javascript into one larger file, rather than separate files. Each file request can take up to 200 miliseconds. So, if you have 10 or more external scripts, it can quickly add to your total loading time. Settings a long expires header on resources that don't change often. This means that a browser doesn't have to keep requesting the same resources over and over again - even if it is just to find out the resource hasn't changed. I have set a long expires on my icon images, as well as base JavaScripts, CSS files. R....
| |