Map Visualization - Zoom to Query Results

Now that zoom to bounds seems to be working I'm wondering if there is a way to trigger an ajax update of the map when the search query on the associated list changes. Currently with the timer triggered update, the map will reset while the user is interacting with it, which is frustrating to say the least. I can start a new thread for this if that is preferable.
 
I didn't look at the address thing. I've never had reports of wrong map placement, so I'm assuming it pilot error of some sort. :)

Do they show correctly in the form on the map element?

-- hugh
 
I sort of figured it out today. I have the map element set to "update as I type." I noticed that if I typed too quickly the geocoding process would get interrupted and the location would remain as the default location, which in my case I had set to downtown Seattle. I need to figure out how to prevent this from happening for the end user. Maybe if there was a way to trigger a geocode on form submit in addition to "as I type"
 
Last edited:
Hmm, we should already take care of that, as we "debounce" the geocoding (so we wait until the user hasn't hit a key for about half a second). And we should also have some logic to handle the case where two geocoding queries still run at the same time.

Got a form I can look at?

-- hugh
 
That map isn't working at all for me, maybe because we're trying to load the map API multiple times, because of the module on that page.

-- hugh
 
That sounds probable. I removed the map module from the edit and details forms. Give it a go now. Note that the map still does not show up on my Chromebook or in the chrome browser on my android tablet.
 
Re triggering the map when the list is updated, yes, that should be possible, with a little event driven js. I'm not at a computer right now, I'll figure it out when I am.
 
I'm not quite sure what you are doing with the geocoding - only two fields seem to be used, the ZIP, and a hidden 'address' field.

What you might try is using the 'geocompletion' feature of a field element. I recently tweaked that so it plays nicely as a geocoding field for the map element. Typing in the geocompletion field will use it's own code to pop up a menu of matching addresses. Once selected, the element will kick off a map geocode using it, to place the marker. You'll need a relatively recent github for that,

Obviously won't fill in the various address components, but those are having to be used separately anyway.

-- hugh
 
I have three fields in this list for city, county, and state and they all play off one another. State is a dbjoin field. When the user selects the state, then the counties for that state show up via the cascade dropdown field. Same goes for the cities when a county is selected. Unfortunately I noticed that when I included the city and state fields in the geocoding operation that I was getting strange locations showing up on the map. I simply took the out of the calculation, realizing that the proper zip and address would work just fine.

Any luck with triggering a map refresh when a filter is applied to the list?
 
The GeoComplete feature is pretty slick by the way. I think I'll take your suggestion and simplify my form using that technique.
 
Using joins for the address geocoding is problematic (by which I mean, doesn't work) because the values are the "value", not the "label". So you get 123 rather than Huntsville for "city" (or whatever). One of those things I've been meaning to fix for a while.

So the new geocomplete integration with the field element is def the way to go.

You can still use your address components for collecting data, just not for doing the geocoding.

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

Thank you.

Members online

No members online now.
Back
Top