Ok heres how I set it up, but I am still getting an encoded result that doesn’t seem right. The the result of the the workflow is “etxlFxlb~R{q@fCwLifArvAN?jS”
I assume I have something in the wrong order?
Ok heres how I set it up, but I am still getting an encoded result that doesn’t seem right. The the result of the the workflow is “etxlFxlb~R{q@fCwLifArvAN?jS”
I assume I have something in the wrong order?
I was actually able to get it to work without using the encoding action. I just used This Google Maps Polygon Coordinated Formatted as text:formatted as URL. I had to use some arbitrary text in the formatted as text to get it to work, but it works great.
If the new encoded action is easier or better to use let me know what I was doing wrong and I will switch to that. Thanks for the help!
Oh well done, that’s the way to do it, you’ve done it correct I think.
I mis-read what you initially asked for here (apologies). The encoding I added is one of Google’s own methods for encoding path data for which I was planning to add anyway since there is a way to decode data too. That’s different to what you needed, I took another look at the example you gave, and it is indeed a URL encoded string so you should be good.
Hi Paul, I’m looking for a plugin that will allow me to display a radius on a map after a user has selected a google autocomplete address.
Then that radius can pull all the locality (suburbs) information for me to store in a database.
Would this plugin be able to achieve that?
Hi @listme
You can do that yes, there’s a draw circle action (amongst a few other ways) that you can use to draw a circle showing a radius.
The data for the circle, like the coordinates which make it up, center point and circumference can all be retrieved from the various states.
Paul
Hi there. I purchased your plug-in about 2 years back for a specific project and it worked brilliantly. A few days back I bought another copy for a new project and I’m having trouble getting the drawing tools to work.
When I use the action “Select Drawing Mode” (after enabling the drawing tools) I get the following error:
On on the Javascript console:
I have tried using the workflow trigger “Drawing tools have been enabled” to do the “Select drawing mode” action but it doesn’t seem like the trigger fires.
Any idea what I’m doing wrong here?
B
Ah, ok that looks like you have something else in the app which has already loaded the maps API. Do you have any other maps plugin installed or have a geographic search box on your page by any chance?
If you have a search box visible which is capable of returning addresses, then set that to not visible to begin with and then make it visible when either the map become visible or the ‘is ready’ state is set to yes. That will force the plugin to load the maps API scripts first before Bubble attempts to load it’s own version.
For the life of me I could not find another object that was loading the maps API script on this page (the entire app is spread over 2 pages).
Then I found it, in the same reusable element that the map object was in.
It was actually a text field that showed the place name at the centre of the selected circle on the map. The text field included a calculated value using the ‘geo coordinates to address’ function.
When I removed the field, all the issues went away.
Unfortunately though, I still used the ‘geo coordinates to address’ function in an action in the reusable. Whenever the action ran, the map behaved very strangely, for example dragging the map would leave the shapes behind and so they would be out of position.
So as a work-around I have removed all the fields and actions that use that calculated formula and the map is behaving as intended.
So it might be worth adding in the documentation that we need to avoid using that calculated function because it took me a while to figure out where the issue was.
If I was to call the Google API direct to convert coordinates to an address would that resolve the issue?
This is one of the best plugins available on Bubble IMHO so keep up the good work!
Blair.
Thanks @blair3
The thing to remember here (and this applies to any plugin that uses Google Maps) is that whenever you use anything which uses location based data, like current user’s location, geographic search boxes, calculated distance conditions etc, then chances are Bubble will load their version of the Google Maps API script as soon as your page renders and before any plugins initialize. I can’t stop this within the plugin but I can detect it. The plugin loads a higher version with a lot more functionality included but Google doesn’t allow multiple versions of their API scripts to run, as weird things can happen.
If you were to open up the dev console, you’ll see something like this below.
The message can also read this instead. It could be useful just to keep an eye on if you ever need to check it.
“google maps api script is being loaded by the plugin with additional places, drawing and geometry libraries included”
I don’t tend to have these issues on my demo page but I would think guessing on other location based functionality on your site, it could cause a problem. I think what you’ve done is correct, so try to ensure the map is loaded before any of the other location stuff becomes visible. There is a state called Is ready that you can use conditionally when it’s set to Yes/true.
When you say “I still used the ‘geo coordinates to address’ function” - can you screenshot that for me?
Thanks, Paul. I’m happy with where it’s at now that I’ve removed the workflow and text fields that used the coordinates-to-address function. I’ve attached a screenshot of the workflow action so you can have a look. But that issue is essentially solved for me.
There is one additional issue I’m having though. It’s with the combination of the Get Viewports action and the Get Viewports Has Completed event.
I fire this Get Viewports action on a button click:
Then, when the ‘Get viewport has completed’ event fires, I zoom the map to the viewport area with this action:
And the result is nothing on the first fire. But if you click the button a second time, it will zoom to the the correct area. It’s like the state is being populated late and the zoom action misses the data.
Is this the correct way to zoom the viewport so that it includes all the shapes drawn on the map? Or is there a better way to do this?
Regards,
Blair.
Ok. Can you try the version I’ve pushed and see if it works first time now.
Hi Paul, installed the new version

but unfortunately no change in behaviour. Zooming the map to the viewport of a list of shapes seems to always be one iteration behind.
The test I use is to draw multiple shapes on the map, drag one of them a long distance away and try to reset the viewport to show all shapes. On the first press the viewport zooms back to the previous dimensions and on the second press it zooms out correctly.
B
Ok I’ll test it fully and figure out why it’s doing it.
Can you check this page and let me know if you have it setup similar
Paul-testing-4 | Bubble Editor
You’ll want to use the “drag ended” event to get the new viewport each time, although button click should work too. I just noticed though, you didn’t refresh the editor to pick up the version I pushed.
It should be this…
Hi Paul, v 1.350.0 absolutely fixed it.
I have it implemented the same way as your test app, the only difference is that I didn’t have a Get Viewport on the shape drag event.
Thank you so much for your help with this.
Blair.
No problems at all.
Hi, Is there any way of setting the default map element location if the user does not allow for his geographic location to be used?
Also, I am having an issue with polygon drawing and area selection. When a polygon is drawn its area is calculated, however if you drag one of the points of the polygon throught an existing line and a cut is made, the area decreases, is there any way of registering overlapping lines with the plugin conditions?
Hey @pork1977gm
I just have a quick question for the plugin. Is there a way to add z-index to the polygons? My app requires polygons to stack and I was wondering if there’s an option for the z-index currently in the plugin or if it’s something that can be implemented in the future. Thanks so much!
Bear with me guys, I’ll take a look at doing both of these and report back soon.
Thank you so much, I appreciate the speedy response