[PLUGIN] - Google Maps Geometry/Drawing + W3W

@pork1977gm. Hey paul, is there a way to clear the set marker lat/long? I have tried clearing the map, clearing the maps states, and executing the remove marker action as well as setting a new marker with empty values for lat/long once the original marker has been removed. None of these methods have been able to clear the stored values in the set marker lat/long once a marker has been set.

Hi @dancoburn89

I’ve just pushed an update which has a new option in the ‘Clear states’ action. You should now see a ‘Set marker’ option that will allow you to clear both the ‘Set marker latitude’ and ‘Set marker longitude’ states.

Hope that helps.

Paul

Fantastic thank you for the speedy update!

Hey Paul.

I recently noted your comment in the plugin page that google will be unfortunately eliminating their drawing tools library, and you have now included an option to enable Terra Draw on the map.

I have a couple questions for you:

  1. I have enabled Terra Draw for the map, but I don’t seen any elements/actions/triggers related to it. Is there supposed to be? Or is there manual configuration required on the users end to set this up?

  2. With that change, does this mean that any of my workflows/triggers/actions based on points/polygons being drawn will now need to be reconfigured to reference Terra Draw?

Also will something like the “Draw Shape” action still work?

Hi @JW13

So this change only affects the drawing tools, none of the rest of the code like the “Draw Shape” action, workflows, coordinates etc will be affected so you should be fine regarding workflows etc.

I’ve tried to make this change as seamless as possible, since it was quite an integral update, but the only action which really had to be re-written was the “Enable drawing tools” action. The same icons that Google used when rendering their version of the drawing tools UI have been used with the Terra Draw code. All of that has been reconstructed to make it match as close as I could get it.

From your point of view, if all being well, you should be good to just upgrade the plugin and not have to touch any of your existing workflows. All states/events etc are populated in the same way. Whilst making the changes, I was working with another user who was using the tools extensively so we’re pretty happy all is working well, but of course if you do run into any troubles then just shout and I’ll jump straight onto it.

There are no special actions or anything that come with Terra Draw, it merely used to replace the UI and logic behind what happens when those drawing icons are clicked.

Paul

Hi Paul,

I noticed that the shape drawing behaviour seems a little different since I upgraded to the latest version of the plugin.

It used to be, when you draw a circle, that you click and drag until the circle reaches the desired radius. Now, it seems that you click where you want the center of the circle, and just move the pointer (don’t drag) to size the circle, and click at the end.

It’s not a big deal but we’ve had a lot of calls from users who think it’s not working because they’re dragging to size their circles.

Is there any way to change the behaviour so our existing user base can still use the drag sizing method?

Regards,

Blair.

Hi Blair,

Yes, I’ve tried to replicate the behaviour of the deprecated Google DrawingTools as closely as possible using TerraDraw, although there are a few minor differences between the two.

That said, could you try this on the demo page and see if you experience the same behaviour? There might be an option available that could adjust how this works. I will take a look.

Let me know if you see the same problem on this page:
https://paul-testing-4.bubbleapps.io/version-test/what_3_words?debug_mode=true

Just click the “Enable drawing tools” button then try drawing a circle in the same way.
You’ll have to let me know how your drawing the circle in your App, so do you use the Drawing Tools UI or are you running the ‘GM - Select drawing mode’ action?

Paul

Hey Paul - thank you for getting back to me so quickly.

On your demo app, it worked both ways - I could drag, or I could click.

In my app, I’m using the ‘GM - Select drawing mode’ action.

Regards,

Blair.

No problems. So there are some differences between “clicking a button” in the Drawing Tools UI and running that action. Essentially they do the same thing, but you can think of the action as simulating the click that you’d normally do within the UI (if that makes sense).

I’ve just been testing the action, and because it now uses TerraDraw, the functionality has changed slightly. I’m not sure if there’s much I can do to change the way that code runs but I’ll have a look at it and see what I can do.

Give me a few hours and I’ll get back to you and let you know.

Ok… scrap the “couple of hours and I’ll get back to you” part!

I’ve just looked at it, and to be double sure, I run it through Claude just to check the code. To try and change it, would mean to hijack the way in which TerraDraw functions work and that’s going to be risky.

So, with Google’s Drawing Tools, it essentially behaves like:
mousedown >begins drawing the circle
mousemove (whilst mousedown) > does the resizing
mouseup > finishes the circle

The TerraDraw way is:
mousedown > set center
mousemove > resizes the circle
mousedown > finishes the circle

They’re fundamentally different interaction methods in the actual libraries which are in use here. If I attempt to override the default behaviour I may run into some issues further down the line.

Do you think you could perhaps display a notice in this area of your app just to say that “Due to recent changes, the drawing functionality has changed slightly…” I’d guess it wouldn’t take users too long to figure it out anyway. Hopefully that’s ok!

Hi Paul,

That’s fine. I just wanted to see if there was any way the old behaviour could be brought back. Thanks for looking into it. All good.

B

There is a mobile version of this plugin which uses the native maps (so no WebView) which is in build process. It will support the drawing tools and all the shapes etc and as much as the original functionality as I can. I’m making progress with it, hope to have it released in the next week or so.