Adding a search box within the google maps visualization

wqwi853

Member
Is there a way to add a search box into the google maps visualization so that way a user can search an address or place within the map itself? I don't see anything for it in the settings.
 
Visualizations just use whatever filters you have enabled on your list. There's an option on the viz settings to 'show filters'.

You can then do normal element filtering, on whatever elements you have (like city name, ZIP, whatever).

And/or you can add a Radius Filter plugin to your list. Set to "Simple" mode, this just gives you a (configurable) dropdown of distances (like 1, 10, 100 miles) and a filed to type an address, which uses the Google places API to give you a menu of matching addresses.

Here's a screencast. Sorry about the slow page loading, my laptop is being crippled by some other stuff running in the background atm (I have several VM's running doing some heavy CPU load tasks).

https://www.screencast.com/t/UHnO8ACBFNK

-- hugh
 
Note that the radius filter plugin isn't part of the core. You'll need to either download it from our downloads page and install it, or do a full github update and "discover" it in J!'s extension manager.

Actually, thinking about it, you'll need to do a github update, because I added that "simple" mode to the radius filter plugin after the last release.

-- hugh
 
I did the github update and I can't seem to get the desired result I wanted.

First off, the auto complete doesn't work. I have an element called address but the list doesn't have any data because I just need this to be able to drop a pin on an address location.

Basically what I'm trying to do is have the visualization tell the person searching the map whether or not a certain address/location falls within a certain kml polygon overlay. I need the search to be able to work with any address/location that can be searched via google maps.
 
Ah, well, then no. The radius search plugin searches for map locations in your list that are within a given radius of the location the user specifies.

We don't have anything to search specified locations against arbitrary overlays.

I don't even think the Google maps API has that ability. You can test if a point is within a polygon with containsLocation(), but that only operates on native maps polygons. And afaik, there's no way to convert a KML overlay to a native polygon, without using some third party tool like geoxml3 to convert the KML overlay to native maps objects.

-- hugh
 
Not a search against the overlay itself. Just a places search within the visualization while the overlay is just there.

mymaps.google.com has something similar in the image provided.

I just want to be able to type in an address and have a pin drop at the desired location but obviously I won't have a list with every address in it so it would have to be utilizing google for the address match.
 
Still not sure what you mean. Just "a places search"? What, asking Google for all "places" within a radius of a certain point?

-- hugh
 
No, a simple address search.

I just want to be able to search any address within good maps and have a pin drop on the location. Just as if you were doing a regular google maps query for a specific address/location.

I don't want to rely on any data in a list. I want to be able to search any address, anywhere, and have that location come up.
 
If you want to type an address and get a marker you can use a form with a googlemaps element
 
I could use a form but that's not what I'm trying to do. I don't want to save any data. Plus, I am trying to be able to utilize my KML overlay as well which can't be done with the googlemaps element.

I just want someone to be able to search a google map to see where their address falls in the KML overlay. It doesn't need to save a record or anything it just needs to be able to let someone know where on the overlay that particular location is.
 
You can set the viz to center on "query string"
  • Querystring - If querystring is selected, you can provide three additional query string arguments on the URL to your viz using a custom link: ?latitude=xxx.xxx&longitude=xxxxxx.xxx&zoom=x"
http://fabrikar.com/forums/index.php?wiki/google-maps-visualization/

So you could use a search form (not saving to DB) for geocoding the typed address, maybe a calc element to create the the correct querystring format, with a redirect plugin URL redirecting to the viz.
 
OK, I may have misunderstood what you are trying to do.

So you just want to be able to type an address, place a pin for that address, and recenter the map on it?

-- hugh
 
OK, well the Radius Search plugin kind of does that. It lets you type an address in a filter field, with geocompletion (so it provides a dropdown of matching addresses), then places a pin on the map at that location. Of course it also asks for a radius, and filters the list according to that radius. But if you don't care about filter results, ie. you don't have any markers you want to show from the list, the filtering doesn't matter. And you could override the layout for the radius filter, to hide the radius dropdown and the filter result message.

-- hugh
 
I've tried the radius plugin the way you instructed in the screencast in the earlier post but for whatever reason I cannot get it to geocomplete with the dropdown of matching addresses.
 
I noticed that this comes up in the web developer tools console

Uncaught TypeError: Cannot read property 'addEvent' of null
at Object.initialize (radius_search-min.js:3)
 
You'll have to point me at the page, it's the only way I can debug JS. Also make sure you have set "Fabrik debug" to "Yes" in the global options, so I can load the uncompressed JS.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top