geolocation listings

4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 2, 2011   (RSS)

By rez - May 31, 2011 - edited: May 31, 2011

I have a map of all locations showing and next to it is a zipcode proximity search. The code is attached and works.

I have a "State" editor that has all of the states in it. They are selected in the locations editor with a drop menu using the advanced table method. All works fine.

Now what i need is to have all locations listed out already by state categories when arriving at this page. So you would have the map with all locations and the zipcode search (already working) and below that, all locations listed under each state headings. When you search by zipcode, the list would be replaced by search results. This is where I get lost.

How can I list all locations by state and then replace them with search results so two lists arent displayed after searching? Below is my code before adding all locations. I should be able to list all locations using a $locationsRecords list and the viewer code for categories found in the sticky thread for tutorials but dont know how to replace it with the search. hope that makes sense.
Attachments:

example.php 11K

Re: [rez] geolocation listings

By robin - June 1, 2011

Hey Rez,

So you want the map to show all locations, but the list to show search results?

Thanks,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] geolocation listings

By rez - June 1, 2011 - edited: June 1, 2011

Sorry, I know this is a mess. I have that part already working.

I have the map showing all locations. I have a search box next to that which will show all locations by proximity when entering a zip. When arriving at the page, you see the map and the search box. Searching reloads the page and puts the list below the search box and map. That all works fine. (the full map here isnt integrated in the search at all, it simply shows all locations)

BUT, in addition to that, when first arriving at the page, I want all locations already listed out under state headings, below the map and search box. So on page arrival you would have the full map and zipcode search box at the top of the page and below that, all locations listed. Most people will be happy already. If you then wanted to do a proximity search, you could use the zipcode search. The problem I am currently having is that after the search, the map, the search box and full list are already there, and now a new proximity list result is added as well. So two lists end up on the page. The full list and the proximity search results. :(

That make sense? I may be going about this all wrong...