That’s right. The returned list of polygons will be only the ones that contain the given lat/lng.
Turned out I needed this functionality in a project I’m involved in at the moment, so I’ve done the changes sooner than expected. It was a little trickier than I first realized so I’ve put together a separate action for this, details below. Try it out and let me know how it works for you, if you need any changes etc then just let us know.
On the demo page (if you scroll down a bit) there’s a section dedicated to the actions called “Contains location”. Sitting by that lot, is this new action which is called “Contains polygon” (I couldn’t think of another name for it so kept them similar).
The 2 purple buttons will test this. The first button just draws 3 shapes onto the map with a few markers situated in each shape. The second button runs the action which takes a list of the polygons (x3) and a list of the markers (x6). The markers can be supplied as either a single pair of lat/lng values or a list of addresses or a list of of lat/lng pairs so you have all options available.
When it runs, it should return all the polygons (as a list of polygon coordinates) for which contain markers. Because it goes through the polygon list and then goes through each of the markers, it will return duplicates. For example, the rectangle in the above image which contains 2 markers, will report back as 2 polygons and they will be duplicated. If you don’t want this behaviour then you can set the option in the action called “Unique items” to Yes.
Paul
This might be a stupid question, but can anyone help - I have a list of addresses that I want to show up on the map as markers as soon as the map is loaded, and I thought this would work but it doesn’t. Any tips?
Hi @ramzizi
If you take off the “each item’s HospAddress” and then you should get the field selections appear like this.
Thank you. Best plug in support on Bubble!
I’ve add some configuration into the “Enable Drawing Tools” action which allows you set up to 6 defined color palettes as show.
On the map, these are what they look like.
Default
Periwinkle Paisley
Pumpkin Fields
Frosted Forest
Mountain Light
WhizKids
Ocean Treasures*
hey @pork1977gm ! I just saw this message (you mistakenly tagged another person so I didn’t get the notification hahah).
I’ve been testing the feature today and it works amazing!
The only improvement in my mind would be the following:
I wanted to use the user’s geo address to get the lat/lng values. The geo address in Bubble returns a single lat and a single lng value. However, the fileds on your plugin requiere lists and there is no “converted to list” operator available.
I was able to do a workaround on this by doing a search for all users:contains the current user’s unique id and then get the lat/lng of all this users (it gets only the current user because of the id constraint).
Here you can see in the “list of latitudes” field how it would see if the field allowed single lat values and in the “list of longitudes” you can see my workaround:
Anyways, it is working properly and I think this is becoming the best plugin I’ve ever bought in Bubble.
Thank you!
Ah sorry about the tagging issue! Great stuff, I like work arounds, glad you got it sorted
Hey @pork1977gm! Recently you fixed an issue for me with map pins not displaying (only a few of them), however, my client passed this to me:
"After deployment (and refresh), all pins show immediately.
But after some time, the pins take longer to generate. The longer we go between deployments the longer it takes for pins to render, and sometimes they don’t render at all.
I believe there was a deployment yesterday, and pins showed up quickly. If we go a few more days I don’t think all the pins will show up at all, no matter how long I wait on that screen for them to show up.
First screen shot is first glance at Listings screen
Second screen shot is about 3 minutes later when pins finally rendered. " (images attached)
Personally, the ones he mentioned that appeared after some minutes never appeared, but it is what he es experiencing. Is there something that we can do about it? Appreciate it!
Ok, can you explain what you mean by “deployment”? Also, can I see the workflows/actions or other config that you use to put the markers on the map? Feel free to PM some screenshots as I’ll get a better understanding of what’s running.
Paul
Sure, by deployment he meant when changes are being pushed from development to live. As for the markers, I don’t have any workflows, just giving the map the info of which markers it should display, it is looking for the Latitude and Longitude inside this data type :
Are there any constraints being set in the “do a search for property listings”?
Hi @pork1977gm !
Is possible to request a action like “WHEN Marker has been resized” or something like that?
Yep, should be able to do that for you. Can I ask how you’re currently resizing a marker?
I have a list of markers, and when I click on one of them, it triggers a “Change mark properties” “Editable=yes”
That’s not resizing it though, that just changes the property to “editable” so you can move it around etc. I can add in an event called “marker properties changed” that triggers after the “Change shape properties” action has run. Would that do the trick? I’ll do the same for the shape properties action also.
Hi @pork1977gm ,
It’s not a very consistent issue, but I’ve noticed it a few times that this action isn’t always returning what should be a positive result, i.e. a point that I know is contained by a polygon. I can’t really get it to reproduce consistently, but I do notice the issue more when it’s a very large polygon (the two times I noticed it was once the polygon covered a whole state, and the other time it covered a city).
Have you gotten any other reports of this? I don’t know if the issue is with the plug in or the fact that I run it on a list. The list isn’t very large though
Cheers
Hi @ramzizi,
I haven’t noticed it yet and this action I was using extensively in a project I’m involved with at the moment. One thing I did do recently though, was I added this code inside the “contains” action directly into the “set list of markers” action and put the shape coordinates option in. So, if you put the “vet’s area_coordinates” directly into this option (shown below) it will save you having to use the “contains location completed” event. Give it a go.
Oh that’s for a list by the way! Might not be suitable for you’re use case here!
I’ll check that out, although I use a backend workflow to create a list of users to display in a repeating group rather than a map, the image you linked is a map option correct?