Hi Tim,<br><br>Yes, the problem is #refreshOn: and...I think you need to call #replace. From what I've seen of the GoogleMap component, <br>you could do something like this<br><br>LBCMapComponent>>refreshOn: aScript<br>
<br> aScript element<br> id: self styleId;<br> replace:[:render | render render: self].<br><br> aScript add: (SUStream new<br> nextPutAll: '(',self map updateMapScript, ').call';<br>
arguments: #();<br> yourself).<br><br><br>LBCGoogleMap>>updateMapScript<br><br> | myStream listenerString functionString |<br> myStream := (WriteStream on: String new)<br> nextPutAll: 'function ';<br>
nextPutAll: 'updateMap(){'; cr; tab; <br> nextPutAll: 'if(google.maps.BrowserIsCompatible()){'; cr; tab; tab; <br> nextPutAll: 'var mapOptions=';<br> yourself.<br> options printOn: myStream.<br>
myStream <br> nextPutAll: ';'; cr; tab; tab; <br> nextPutAll: 'var map=new google.maps.Map2(document.getElementById("';<br> nextPutAll: htmlID;<br> nextPutAll: '"),mapOptions);'; cr; tab; tab; <br>
nextPutAll: '// *** custom script below'; cr;<br> nextPutAll: stream contents; cr; tab; tab; <br> nextPutAll: '// *** custom script above'; cr; tab; tab;<br> nextPutAll: variable;<br>
nextPutAll: '=map;';<br> yourself.<br> listenerString := 'google.maps.Event.addListener(' , variable , ', "'.<br> functionString := self functionString.<br> eventHandlers keysDo: [:event | <br>
myStream cr; tab; tab; <br> nextPutAll: listenerString;<br> nextPutAll: event;<br> nextPutAll: functionString;<br> nextPutAll: event;<br> nextPutAll: '&x=" + x + "&y=" + y + "&z=" + z)'; cr; tab; tab; <br>
nextPutAll: '}); // end anonymous function and addListener()';<br> yourself.<br> ].<br> ^myStream cr; tab;<br> nextPutAll: '} // end BrowserIsCompatible()'; cr;<br>
nextPutAll: '} // end ';<br> nextPutAll: variable;<br> nextPutAll: 'Init()'; cr;<br> contents.<br><br>Maybe it isn't the best solution, but it should work fine<br>Cheers,<br>
Juan M.<br>
<br><br><div class="gmail_quote">On Wed, Sep 16, 2009 at 10:05 PM, Timothy James Ziebart <span dir="ltr"><<a href="mailto:timothy@churchmilitant.org" target="_blank">timothy@churchmilitant.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Ok gentlemen I am hoping you can comment on whether or not this has
been done properly. I have created two subpanes (there are 8 in
total). By the way I have 3 listboxes dynamically changing the list
contents -- so it is working perfectly but for one hurdle.<br>
<br>
<b>createMapPane<br>
| pane |<br>
<br>
pane := LBCMapComponent new.<br>
pane name: 'mapDisplay'.<br>
pane styleId: self liveMapId.<br>
pane model: model.<br>
^pane.</b><br>
<br>
<b><div>createRegionListBox<br>
| pane panes list |<br>
list := self session findCodeByParent: 'region'.<br>
panes := OrderedCollection<br>
with: (self paneNamed: 'nhoodList')<br>
with: (self paneNamed: 'cityList')<br></div>
with: (self paneNamed: 'mapDisplay').<div><br>
pane := SFListBox new.<br>
pane name: 'regionList';<br>
items: list;<br>
lines: 5;<br>
printSelector: #asString;<br>
owner: self;<br>
<br>
when: #changed:<br>
send: #regionSelectionChanged:<br>
to: self<br>
refresh: panes.<br>
^ pane</div></b><br>
<br>
The map pane is to be updated when a change has been triggered in
regionList. When regionList is change the regionSelectionChanged
method is called which in turn calls updatePane when completed. <br>
<br>
<b>updatePane<br>
self updateRegionPane; updateCityPane; updateHoodPane; updateMapPane</b><br>
<br>
The updateMapPane executes the following:<br>
<br>
<b>updateMapPane<br>
| pane newpane|<br>
<br>
pane := self paneNamed: 'mapDisplay'.<br>
newpane := LBCMapComponent new.<br>
newpane<br>
model: model;<br>
styleId: self liveMapId;<br>
name: 'mapDisplay'.<br>
<br>
self replacePane: pane with: newpane.</b><br>
<br>
which in turn fires the refreshOn: method is on LBCMapComponent.<br>
<br>
<b>refreshOn: aScript<div><br>
<br>
aScript element<br>
id: self styleId;<br>
replace:[:render | render render: self].<br>
<br></div>
"I am not sure what needs to be done here"<br>
aScript add: [ ]</b><br>
<br>
which will in turn execute renderOn: <br>
<br>
<b>renderOn: html<br>
|myMap|<br>
myMap := self map.<br>
<br>
myMap renderOn: html.</b><br>
<br>
where map returns<br>
<br>
<b><div>map<br>
<br>
^LBCGoogleMap new<br>
setCenter: model coordinates zoom: model zoom;<br></div>
setUIToDefault;<br>
yourself.</b><br>
<br>
All the components are updated correctly however the map does not
redraw. If I refresh the browser than the map draws correctly -- so it
has to do with the script in the refreshOn method, correct? If so I,
my ignorance of javascript has left me at a loss as to what needs to be
done. Do I need to call replace? Any suggestions? Thank you in
advance.<div><br>
<br>
<blockquote type="cite">
<pre>_______________________________________________
seaside mailing list
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
</pre>
</blockquote>
<br>
<br>
<br>
</div></div>
<br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br>