Google Map Block - Searchable

I have the Maps block enabled in my table, but need to be able to search the map with an address and have it show the “nearest” locations from my database on the map. Is this possible? PLEASE say it is! ! Basically, it’s what I do in Google Maps, but can’t seem to figure out how to get a search box onto my Maps Block map!

6 Likes

You can add a fake Record with your location and select it on the map :smile:

Appreciate this suggestion! What I actually need to do is be able to search addresses that are NOT in my database to see what locations IN the database are closest to the address I’m searching up. I just need a search box for the map in the map block.

2 Likes

I totally agree with this product suggestion! The Maps Block is simple and great for exposing location databases, however in the somewhat common use case where a user needs to find records located near their current physical location, the block doesn’t provide much help—the user needs to navigate the map location and zoom from the overall starting map down to their specific location to do this, and has no other way to “search” the map.

A very small addition that would solve my use case of a user finding nearby records would be to simply query the HTML5 Geolocation API for the user’s current location and if they accept the request, navigate the map from the global view down to feature their current location and zoom so that a few nearest neighbor records are shown.

The Geolocation API getCurrentPosition function is very well supported by all major browsers and used specifically in Google Maps and other mapping products to solve this problem very simply!

@Melanie_LaDue @drassi @Elias_Gomez_Sainz

Did you guys ever find a way to do this or a workaround? Trying to figure out a way to do this now.
Thanks

Nothing like this was added unfortunately : (

You likely have to create a wrapper, where you rebuild a map and just import coordinates from the airtable geocode data. It’s too bad

1 Like

Here’s how to resolve this (somewhat) today: In a script block…

  • First, an assumption; this app is running in Airtable on a notebook, ergo - the need to run this from a variety of unknown future locations.

  • Create a “search” UI that prompts for current location. This could be a call to a service that extracts lat/lng based on IP data and/or other metrics. Since the DOM is not accessible from Script Blocks, you cannot use HTML5’s knowledge, but you can mimic this ability in other ways.

  • Use the current lat/lng to find nearby records based on distance geometry (fully possible in Script Blocks).

  • Collect the list of nearby items and display as a result set in the Block itself (as a table) with links to each associated (nearby) record. You could also flag the actual records in some way to push them into a search results view.

@Bill.French
I need a way to search the map block for a new address that is not currently in my Airtable records. Basically just a search bar that drops a pin for the address I entered.

The use case would be to say that I am trying to book a new order, and I need to determine which orders are close by this new orders address, to determine what worker to give it to.

I don’t know for sure if that is possible with the scripting block, but I don’t think it is. Do you know if there is a way around this?

Thanks

Okay - so let’s unpack this more — enter an address - that really doesn’t need a map, does it?

Given an address, a Script Block (while challenged to display a map) can still compute it’s relative nearby-ness to other known locations.

Question - in your process, is it possible to determine who to give the order to after the order has been placed? (i.e., why not just take orders and have a smart API process that figures all this stuff out behind the scenes?)

Hmmm good call. That may be a better way to go about this actually.

Basically an order is placed online or over the phone, then when the order is inputted into Airtable we assign a worker at that time.

Maybe the best way for me to go about this is to enter the new address in a scripting block, and then from my current records, it will display the top 5 closest orders to the new address or something along those lines.

Why do anything in a block? I may be missing something, but my inclination is to build a smart(er) system that doesn’t need human decision points (if at all possible) and even if there are some ambiguities with certain orders, treat those as process exceptions and provide a way to introduce human assistance when and only when needed through alerts and such.

Yes - this is entirely possible in a Script Block - a simple utility that lists the closest orders and selection links that perform a matching or linking process or whatever is needed.

@Bill.French

Why do anything in a block? I may be missing something, but my inclination is to build a smart(er) system that doesn’t need human decision points (if at all possible) and even if there are some ambiguities with certain orders, treat those as process exceptions and provide a way to introduce human assistance when and only when needed through alerts and such.

I think that may be pretty complex for us. We have our whole system built and processes set up except for this last part. We are just trying to find a better way to optimize this step. Instead of comparing the Airtable map block that has our plotted orders, to the address we are trying to book plotted in Google Maps, and from there determining the best day and worker to book it for.

There are many things that determine what worker an order gets assigned to. Some workers can only do certain services. We need to book services for each day of the week and have their locations as close together as possible for each day, but a worker can also only perform so many services a day before they are over capacity. Etc…

As you said, I am sure there is a much smarter and automated way we could go about doing this, but I’m not sure if we have the necessary time/skills to build this at the moment.

Yes - this is entirely possible in a Script Block - a simple utility that lists the closest orders and selection links that perform a matching or linking process or whatever is needed.

Is there somewhere you can point me to that may help with this? I’ve been doing some googling but haven’t had much luck as of yet. If I can get this built it would be perfect for us.

Thanks again for all the help!

Well, the tools necessary to do this are few in number and as you said, you really just want to meet this essential requirement. Your business exists because you made some good choices, so I believe you know what’s best and a simple closure of the current gap is probably wise.

What I’m suggesting won’t be found in Google because Script Blocks are so new - there’s probably not a hundred people on the planet that even know how to code in Script Blocks.

I would start with something simple - about a hundred lines of code that prompts for an address and then lists all the current orders/workers that are closest to that address.

Once you have that, then decide if it needs more or it closes the current gap.

You can build this yourself (with Javascript) or you can post a request here on the forum. I also have some cheap labor that could help at about $0.99/line of code and probably do it tomorrow.

You can build this yourself (with Javascript) or you can post a request here on the forum. I also have some cheap labor that could help at about $0.99/line of code and probably do it tomorrow.

Thanks Bill. I will try my best and give it a go myself first. If I can’t get it sorted, I will post a request on the forum like you suggested or possibly contact you about that labor.

Thanks for taking the time to talk to me about this today. Cheers

2 Likes