Gmaps Demo and external JS Resources [message #34137] |
Tue, 19 June 2007 09:31 |
Eclipse User |
|
|
|
Originally posted by: csad5752.uibk.ac.at
Hello,
Being new to RAP, i tried the Google Maps Demo (after adapting it for M4),
and it is so cool and works well.
Then I tried to add some external .js files that implement custom overlays
for google maps.
I did it similar to the example, ie.
1) make a Java class that implements IResource (isExternal returns true,
getLocation gives an Url to the file on my server)
2) add the class as to the Extensions under org.eclipse.rap.ui.workbench
resources.
When I run the program, I sometimes get an error from my .js files saying
that the google maps API classes (eg. GOverlay, GIcon) are not defined. I
believe that my external .js resources are loaded before the Demo's
GMapAPIResource is loaded, thus producing the error. However, this does not
happen all the time - sometimes it works just fine. Also, moving Resources
up or down in the Extensions tab does not change anything.
Is there a way to ensure that a certain Resource is loaded first? Or am I on
the wrong track here?
Any help would be greatly appreciated! Thanks in advance.
-Flo
|
|
|
Re: Gmaps Demo and external JS Resources [message #34173 is a reply to message #34137] |
Tue, 19 June 2007 13:06 |
Eclipse User |
|
|
|
Originally posted by: rsternberg.innoopract.com
Hi Florian,
are your js files being executed directly on load? If so, you should
probably wrap all the logic that depends on other resources in functions
and call those those functions at some point when you can be sure that
all needed resources have been loaded.
Just a thought, I'm not sure if this solves to your problem.
Regards,
Ralf
Florian Köllich schrieb:
> Hello,
>
> Being new to RAP, i tried the Google Maps Demo (after adapting it for M4),
> and it is so cool and works well.
>
> Then I tried to add some external .js files that implement custom overlays
> for google maps.
> I did it similar to the example, ie.
> 1) make a Java class that implements IResource (isExternal returns true,
> getLocation gives an Url to the file on my server)
> 2) add the class as to the Extensions under org.eclipse.rap.ui.workbench
> resources.
>
> When I run the program, I sometimes get an error from my .js files saying
> that the google maps API classes (eg. GOverlay, GIcon) are not defined. I
> believe that my external .js resources are loaded before the Demo's
> GMapAPIResource is loaded, thus producing the error. However, this does not
> happen all the time - sometimes it works just fine. Also, moving Resources
> up or down in the Extensions tab does not change anything.
>
> Is there a way to ensure that a certain Resource is loaded first? Or am I on
> the wrong track here?
>
> Any help would be greatly appreciated! Thanks in advance.
>
> -Flo
>
>
|
|
|
Re: Gmaps Demo and external JS Resources [message #34241 is a reply to message #34173] |
Tue, 19 June 2007 14:06 |
Eclipse User |
|
|
|
Originally posted by: csad5752.uibk.ac.at
Hello Ralf,
yes, that might just be the problem: the code is executed on load.
will try your suggestion.
thanks a lot!
Regards,
Flo
"Ralf Sternberg" <rsternberg@innoopract.com> schrieb im Newsbeitrag
news:f58kbk$nji$1@build.eclipse.org...
> Hi Florian,
>
> are your js files being executed directly on load? If so, you should
> probably wrap all the logic that depends on other resources in functions
> and call those those functions at some point when you can be sure that all
> needed resources have been loaded.
>
> Just a thought, I'm not sure if this solves to your problem.
>
> Regards,
> Ralf
>
> Florian K
|
|
|
Powered by
FUDForum. Page generated in 0.05190 seconds