[Chameleon] looking for help with zoom to features bugs

Delfos, Jacob jacob.delfos at maunsell.com
Wed Apr 5 20:13:28 EDT 2006


>From what I can tell you change the state of the mapfile on the
server-side, and then send a command to the client to update the map. I
think doing this fails to take into account some of the things that may
have happened on the client-side. I suspect that on the client-side,
your bounding coordinates remain the same even after your Iframe has
updated the mapfile. So when you zoom, the changes from your
SearchResults get overwritten.

You could consider putting some javascript in your SearchResults.phtml
that will actually get the map to zoom to an extent, but using the
client-side interface. That way, you don't bypass anything, and
everything should work as expected.

You could take the function "ApplyBoundingBox" from the Boundingbox
widget, and put it in the page. Then use javascript in your results to
make a call to that function with the desired extents. Of course, it
would make your page submit after the iframe returns, making you lose
your results, unless you use the JSAPI, so the page doesn't have to
submit (which I recommend).




> -----Original Message-----
> From: chameleon-bounces at lists.maptools.org 
> [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of 
> Jennifer Shanks
> Sent: 6 April 2006 01:45
> To: chameleon at lists.maptools.org
> Subject: [Chameleon] looking for help with zoom to features bugs
> Hello list,
> I'm work for a non-profit organization and we're developing an 
> application that helps users to find parks, campgrounds and trails 
> ( The application includes a search 
> widget that allows one to search by zip, city or county.  When the 
> search results load, I also want the map to zoom to the extent of the 
> selected features.  I added some code to the search results page 
> (SearchResults.phtml) that does this.
> However, there are some bugs that I've not been able to figure 
> out.  I've attached the code and am hoping that someone might have a 
> chance to take a look.
> If you look at lines 502-504 in SearchResults.phtml you can see that 
> I am setting the map extent and saving the session.  If I save and 
> open the map file that is generated, I see that the map extent is 
> updated but the reference map extent remains the same.  I'd like to 
> figure out how to get the keymap to draw properly when the extent 
> changes.  The other problem is that the map navigation tools don't 
> recognize that the extent has changed.  If I attempt to zoom in after 
> using the search tool, the zoom in tool is still working with the 
> original map extent.
> To see these bugs in action, visit the link above, search for the zip 
> code 94546 and then try to zoom in on a park!
> Any suggestions on how I can fix these problems would be much 
> appreciated.
> Regards,
> Jennifer
> ****************************
> Jennifer Shanks
> GreenInfo Network
> 116 New Montgomery, Suite 738
> San Francisco, CA 94105
> (415) 979-0343 x 306
> (415) 979-0371 FAX
> **GreenInfo has completely re-done our web site
> Go to: www.greeninfo.org

More information about the Chameleon mailing list