1. We suggest you do NOT update to Joomla 3.8.10 until we can resolve an issue it causes with caching in Fabrik. If you do install it, you'll need to disable Joomla's "System Cache" in the global System settings.
  2. Apologies for the recent server outage, a planned migration by our host provider to a new location turned into a bit of a nightmare.

Adding a search box within the google maps visualization

Discussion in 'Community' started by wqwi853, Jun 7, 2018.

  1. wqwi853

    wqwi853 Member

    Level: Community
    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.
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    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
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    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
     
    wqwi853 likes this.
  4. wqwi853

    wqwi853 Member

    Level: Community
    Looks like I'll be doing the github update tonight.
     
  5. wqwi853

    wqwi853 Member

    Level: Community
    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.
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    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
     
  7. wqwi853

    wqwi853 Member

    Level: Community
    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.
     

    Attached Files:

  8. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    Still not sure what you mean. Just "a places search"? What, asking Google for all "places" within a radius of a certain point?

    -- hugh
     
  9. wqwi853

    wqwi853 Member

    Level: Community
    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.
     
  10. troester

    troester Well-Known Member Staff Member

    Level: Standard
    If you want to type an address and get a marker you can use a form with a googlemaps element
     
  11. wqwi853

    wqwi853 Member

    Level: Community
    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.
     
  12. wqwi853

    wqwi853 Member

    Level: Community
  13. troester

    troester Well-Known Member Staff Member

    Level: Standard
    You can set the viz to center on "query string"
    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.
     
  14. wqwi853

    wqwi853 Member

    Level: Community
    Hmmmm, interesting. I'll give it a shot @troester

    Thanks for the direction.
     
  15. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    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
     
  16. wqwi853

    wqwi853 Member

    Level: Community
    Exactly.

    Sent from my SM-G950U using Tapatalk
     
  17. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    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
     
  18. wqwi853

    wqwi853 Member

    Level: Community
    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.
     
  19. wqwi853

    wqwi853 Member

    Level: Community
    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)
     
  20. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    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
     

Share This Page