Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Gmaps Demo and external JS Resources
Gmaps Demo and external JS Resources [message #34137] Tue, 19 June 2007 09:31 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Debug RAP demo app
Next Topic:Launching RAP app on Linux
Goto Forum:
  


Current Time: Thu Mar 28 23:20:31 GMT 2024

Powered by FUDForum. Page generated in 0.03033 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top