Opened 16 years ago
Closed 15 years ago
#2 closed enhancement (fixed)
provide dynamic loading of defs as an add-on
Reported by: | madair | Owned by: | madair |
---|---|---|---|
Priority: | minor | Milestone: | 1.0.0 |
Component: | core | Version: | |
Keywords: | Cc: |
Description
As suggested by Richard, the default build should include just the core library with no dependence on OpenLayers code. In this case, projection definitions must be loaded through a script tag independently of the core library.
Dynamic lookup of def files can be provided by over-riding certain methods of the Proj4js object in a separate JS file which woudl be included in a dynamic lookup build.
Attachments (2)
Change History (8)
follow-up: 2 comment:1 by , 16 years ago
Status: | new → assigned |
---|
comment:2 by , 16 years ago
Replying to madair:
two important changes:
- dynamic loading using script tags removes much of the dependencies on OpenLayers and it also means that a proxy script is no longer required. Naturally IE behaves differently in that there isn't an onerror method on the script tag so a work-around is used.
- the above change means only 3 methods from OL are required to support inheritence. A copy of these is implemented in the Proj4js namespace to simplify script loading.
We are using PROJ4JS along with OpenLayers and dynamic loading is of major importance. Following your explanation, I have produce a version of proj4js.js allowing dynamic loading with just the addition of de OpenLayers.Utils.Try method(). It is attached to this ticket.
follow-up: 5 comment:4 by , 15 years ago
dgrichard: can you a diff against the proj4js trunk please? I have trouble applying the patch as supplied.
Also, I would hesitate to put synchronous loading back in. In Javascript it seems that asynchronous loading is usually preferred so that the browser won't lock up. Maybe this patch can be coded as an add-on js file that overrides the default methods and included only if required?
comment:5 by , 15 years ago
Replying to madair:
dgrichard: can you a diff against the proj4js trunk please? I have trouble applying the patch as supplied.
Also, I would hesitate to put synchronous loading back in. In Javascript it seems that asynchronous loading is usually preferred so that the browser won't lock up. Maybe this patch can be coded as an add-on js file that overrides the default methods and included only if required?
You're right and that what we are doing : overriding the default methods by just adding it after the proj4js is included ! I am going to attach the javascript file we are using.
comment:6 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
added at rev #1612
Thanks for the contribution!
changeset:21
two important changes: