Google Maps examples?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Google Maps examples?

Kurt Thams
Anyone have an example (w/ source) of Seaside working with Google Maps?

I'm stumbling over a number of things, including how to get the <body
onload()="initialize()" onunload="GUnload()" >    to work so it
initializes the map stuff.

- kurt

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Google Maps examples?

Lukas Renggli
>  I'm stumbling over a number of things, including how to get the <body
>  onload()="initialize()" onunload="GUnload()" >    to work so it
>  initializes the map stuff.

Override #updateRoot: in your component. The attributes of the body
tag can be changed by accessing aHtmlRoot bodyAttributes.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Google Maps examples?

Kurt Thams
Lukas Renggli wrote:

>>  I'm stumbling over a number of things, including how to get the <body
>>  onload()="initialize()" onunload="GUnload()" >    to work so it
>>  initializes the map stuff.
>>    
>
> Override #updateRoot: in your component. The attributes of the body
> tag can be changed by accessing aHtmlRoot bodyAttributes.
>
> Lukas
>
>  
That certainly helps, but I'm still having other problems. (For example,
the map controls will render
but the map itself doesn't.

Has anyone succeeded in making a working example?
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Google Maps examples?

cedreek
I once experimented something... was kind of working but not nice code
at all as I tested lots of function (javascript mix with smalltalk
code) !

did you put your proper gmap key ?  this could explain why the map is
not showing...

2 important method I guess

updateRoot: aRoot

        super updateRoot: aRoot.
        aRoot title: 'test GMAP'.
        aRoot linkToScript: self class gmapKey. "link to your gmap key"
        aRoot addScript: self gmapScript. "here put the google adress of js,
I had a local copy"
        aRoot bodyAttributes
                at: 'onload'
                put: 'load()'.
        aRoot bodyAttributes
                at: 'onunload'
                put: 'GUnload()'

renderGmapOn: html

        html html: ' <div id="map" style="width: 950px; height: 400px"></div>'



Sorry I cannot spend more time on it, but this was working for me and
I can't really send you the code as it won't work.

HTH

Cédrick

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Google Maps examples?

cedreek
2008/3/25, Kurt Thams <[hidden email]>:

> Incredible. Here's what it was:
>
>  Your code:
>
> html html: ' <div id="map" style="width: 950px; height: 400px"></div>'
>
>
> My code:
>  html html: ' <div id="map" style="width: 950; height: 400"></div>'
>
>
>  Note that I was omitting the "px". For some reason, this worked okay when I was serving up the file statically using Apache, but not with Seaside.
>
>  I also tried using "width: 50%" and that didn't work either.
>
>  Any guesses why that would be?
>
no idea. maybe seaside encoding??  Have a look at the generated code...

Anyway, there must be a better way to do that in plain seaside like:

html div
     id: 'map';
     style: 'width: 950px; height: 400px'


or have a a CSS instead of inlined... width: and height: are not
defined for WATag (but in WAObjetctTag and WAImage).

How others would do that (cc'ing to seaside list again) ?


Cédrick

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside