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:
document.ECWView1 = new NCSJSView("100%", "100%"); |
document.ECWView1.SetCallbackName("onPercentComplete", "myprogress"); |
So, if you have an ECWP enabled website, if you want to experiment, with OTD, you only have to make these simple changes to your code.
The one thing that you will want to be aware of is the "cross-domain scripting" rule. Essentially, when using browsers are limited to calling resources only from their local domain. For example, JavaScript on iws.erdas.com can only call resources from iws.erdas.com. In our situation the resources that we are interested in our the image tiles from IWS, or perhaps a GIS Server. Both of these items may not be on the same server. When using ECWP, we don't have to worry about this, because the ECWP control is able to request information from different servers. It is when you are only using JavaScript that you have this limitation.
So - in order to get around this limitation when working with JavaScript - you need to pass all external requests through a server-side component. IWS has a built in server-side component that makes it very easy to do just this.
In the IWS Admin Console:
- Login to the server
- Select > Tools
- Select > Options
- Select > Proxy
In the presented dialog box list all the external websites you would like to access and apply your changes.
Now, you can request your external resources, and the requests are automatically routed through the server-side component of IWS.