[PLUGIN] - Google Maps Geometry/Drawing + W3W

Do you have a a field for the shape name? You’ll need that also.

Hey! I just received this error message from a customer that apparently has been happening frequently but I cannot replicate it, I don’t have further info so by just looking at the error message do you know what the issue may be? Thank you!
Error

hey hey!
Ok thanks for letting me know, I’ve taken a quick look and I think it’s failing during the calculation of getting the center of a polygon. If I’m correct and you don’t use that, a quick fix would be to set the “Get center” option within the Draw shape action to No.

Can I ask, when and where in your workflow do you run the draw shape action? Send us a screenshot. Does it run on page load or anything like that?

Paul

1 Like

Hy @pork1977gm , I have the field “Name of shape (Area 1, Area 2, Area 3)”, the field “Shape type” (polygon), and the field “Coordinates”(list of texts coordinates that form a polygon).
1 Captura de tela 2023-06-27 140833

The work flow its like the image above. First I “Enable Drawning tools”, “Add a pause before next” and “Draw a list of Shapes”. But the shapes are not being drawn after I click on the action.

Are there any errors in the console at all? Can you open up your editor then I can just jump in and figure out the problem. If so, PM me the link.

The conditions are that the types and coordinates fields should be populated (which you have) AND the list counts are the same. Might be worth checking that also.

Finally I got it, I just changed the loading data to custom states and exclude one of “Add pause before next” from the workflow.

Also It would be interesting if could load a description for each Shape in the map, but I dont want abuse of you, let this topic to another time xD. Thanks a lot bro

Great, glad you got it working. I will add a description or label that can appear inside each shape. I could actually use that for something I’m working on right now so once I’ve added it, I shall let you know. There is already an InfoWindow option which might be ok for you to use at the moment.

1 Like

Paul! The list of pins is not displaying only a couple of them, what might be causing this? Loom | Free Screen & Video Recording Software | Loom

Can you do a screenshot for me of where about the “set list of markers” action is running?

I do not have that action, it’s just the map displaying the markers. Should I trigger that when page is loaded or for a specific event?

@hey
Ok, I think I’ve found the problem now. I’ve just pushed an update to fix it. I forgot to put a condition on when to display infoWindows. Install the update and let us know if it fixes it.

@agrobusbrasil
You can now put labels on shapes. The options shown below are in the Draw shape action, but there are similar options inside the Draw list of shapes action also so you can provide a list of labels that’s in the same manor as the rest of the options in that action.

Labels don’t appear right in the center, their center point is the top left corner of the text element rendered, but depending on what you’re doing, you should hopefully be able to adjust the position using the offset option.

image

Also, the following actions had to be updated to support the removal of the labels when the shape gets removed. Remove marker/shape, Remove selected shape, Clear map and Change shape properties.

Hope that helps,
Paul

2 Likes

Yes it did work! Thank you for doing this!

1 Like

No probs!

1 Like

The updates were amazing! Thank you for solving our demands, this plugin is becoming very versatile.

Hi @pork1977gm , I am building a delivery app where stores draw their delivery zones in my app using your plugin. So, I’ll have multiple polygons saved in my db.

I have the user’s latitude/longitude coordinates as well.

I need to show to the user only the stores that deliver to his location.

So I need to find which polygons contain the user’s latitude/longitude coordinates.

I thought I could do that with this action:

image

But apparently I can only a evaluate one polygon at a time, which is not good for me since I plan to scale to hundreds and thousands of stores (each one with unique delivery zones).

Am I understanding something wrong here? Is there something I could do about this? What would you suggest?

Note: All this must happen in a backend workflow.

Thanks!

Assuming you have a list of polygons? Can you run a backend workflow on a list of those polygons and feed each one into the ‘polygon coordinates’ field whilst always keeping the user’s location the same? will that work?

I guess that would technically work but, you know, recursive workflows with thousands of iterations or scheduling workflows on lists of thousands are not very efficient alternatives in Bubble now with the new WU pricing.

But if you don’t see any other option I guess I’ll have to consider it or just forget about delivery zones at all.

Please let me know if you see any other alternative.

Thanks!

I can make it work with a list of polygons but I’m so snowed under right now, I wouldn’t be able to get around to doing it for at least a week or two. If you don’t mind bearing with me, I’ll try and find some time next week to modify it, but no promises!

1 Like

That would be awesome, thanks! I’ll wait

1 Like

What do you need returned in the result of step x…? do you want the same list of polygons returned that you feed into it, but filtered out the ones which don’t contain the user’s location? So in other words, the returned list of polygons will only be the ones where the lat/lng resides within.

1 Like