[PLUGIN] - Google Maps Geometry/Drawing + W3W

Perfect! That works! I’m drawing some pretty complex polygons must be about 42,000 coordinates total. Where can I find the section to remove the white circle? They are slowing down the page speed:

This is such an awesome app and your Technical Support is the best I’ve encountered.

Thanks,
Travis

1 Like

Nice! and no worries with support, it helps me make the plugin better.
So those white dots (vertices) appear when the shape is editable, set the “Editable” option to No and they’ll disappear.

@pork1977gm I figured it out, the Change Shape Properties was set to “Yes” fixed that by changing to “No” and it’s good to go now! Thanks again for all your help.

1 Like

Hi Paul,

I’ve been looking at your plugin and it looks fully featured (if somewhat overwhelming for me), so I though it would easier to ask the questions directly to you with my use cases…

  1. We have the polygons and multipolygons for every country in the world and would like to check when we send a message to a user if they are in the country of question (the use case for this is that the FCDO in the UK send country alerts to citizens) we want to be able to see when the alert is sent if the recipient is actually in country or merely 'following that country. countries can be polygons or multipolygons (think USA and Alaska or Hawaii not being close to the main body of the country)

(our polygons are long.lat,long.lat,long.lat and our multipolygons are long.lat,long.lat,long, lat**;**long, lat,long.lat,long.lat)
We want to be able to store in the database "in country’ or ‘out of country’ when an alert is sent to the user, and if they read the alert later (ie if they land in country) then we get an updated status to say in country, again this will be stored in the database we will not store their actual location.

  1. We have polygons again (single and multipolygon) from the environment agency in the UK and have created groups for all of these, we want to allow a user to use their current position or any given position and obtain a list of all the flood areas that are covering that point.
    (our polygons are long.lat,long.lat,long.lat and our multipolygons are long.lat,long.lat,long, lat**;**long, lat,long.lat,long.lat)

  2. we want to allow the user to generate a polygon or multipolygon shape and attach it to a ‘group’ so that when users are at a location or searching a location they can see what groups are avalaible to join - the use case for this is something like a festival when we want to create a boundary around a location that may not be postcode specific. - right now we get the user to optionally add postcodes to their groups, but I think the polygon is the way to go.

  3. we want to be able to show all the possible polygons on a map so that a user can drop a pin and see what’s avaliable and what’s nearby etc - think police force districts local authorities.

I’d be grateful if you could confirm and if so point me in the right direction.

thanks in advance

Robbie

Hi Robbie,

If you can bear with me, I’ll come back to you on this. These types of questions always put my head into a spin, but what you ask for can be done.

Paul

No worries, speak soon

Robbie

PS for others interested in some decent sources for polygons…

  1. our country polygons come from this URL (World Administrative Boundaries - Countries and Territories — Opendatasoft) there are loads of different data sources in there that make quite interesting datasets in there that may be of interest in some of the others on this trail.

  2. our flood area shapes comes directly from the environment agency here in the UK, the have some 4.5k of flood areas across the country and can be found here , again some might find this interesting. (http://environment.data.gov.uk/flood-monitoring/id/floodAreas?_limit=5000)

  3. we also have one for the met office, however it’s restricted by an API key, but if anyone is interested you can find out more here (Met Office DataPoint - Met Office)

question for the wider collective and users of the plugin,

I have a GEOJson file that contains multipolygons that produces this when displayed though the plugin…

however when I extract the coordinates and plot them onto a map I get this…

which looks like the ‘pen’ is not being lifted between moving from the last coordinate of one shape to the first coordinate of the next shape.

I’ve tried various things like having each shape contained with combinations of brackets eg…

[[x,y,x,y,xy,x,y,x,y],[a,b,ab,a,b,a,b,a,b,a,b]]

{[[x,y,x,y,xy,x,y,x,y],[a,b,ab,a,b,a,b,a,b,a,b]]}

{x,y,x,y,xy,x,y,x,ya},{b,ab,a,b,a,b,a,b,a,b}

“lat”:x,“lng”:,y

does anyone know off the top of their head if it’s possible to have multiple non connecting polygons on the map and if so how did you delimit them?

Can you send me the GeoJSON file (or contents) to me and I’ll try and figure out what’s going on. I think it will be to do with the way the coordinates are being reconstructed again. If it’s large, email to pork1977gm@gmail.com

When you say… “when I extract the coordinates and plot them onto a map”
What action did you use to do that?

Paul

Hi Paul, I know you and I discussed this, but for the sake of anyone else on the trail that follows your work and may be interested in this for their own purposes.

The GEOJson was read in python by a script that I wrote, it then extracted all the polygon shapes and split each shape set by a ; and then saved this as a text file.

so you get x,y,x,y,x,y,x,y;a,b,a,b,a,b,a,b;c,d,c,d,c,d,c,d as a single line of test where each x,y or alb or c,d represents a coordinate pair that makes a closed polygon shape.

And as demonstrated when we use the shape coordinates in the workflow action and select the item split by (;)Random Item, we get each of the shapes.

@pork1977gm I feel like this is possible but haven’t been able to find the right settings. I am trying to update the position of a pin by dragging it to a new position on the map and updating the Lat/Long on the record with the new location. I can drag the marker pin successfully, but is there an event that is triggered when the marker drag is complete? There’s two sets of “a drag has ended” events in the plugin but both are triggering the same way on my end (when the Map itself is dragged, not the marker drag ending).

Hi @tchristian

No worries. So when a marker has finished being dragged to it’s new position, the states “Set marker latitude” and “Set marker longitude” should update with those new coordinates.

There are events called “drag has started” and “drag has ended” which should trigger when either markers or shapes have started/finished being dragged, but you might be able to get away with not using these since the update is pretty quick, hopefully quicker than it takes for the next step in the workflow to run.

I can’t see 2 sets of the same events though, you have the map dragging ones which are “map drag started” and “map drag ended”.

Paul

Hi @pork1977gm , I would like to know if is possible remove a drawning polyline…
I mean, I started drawing and I want to delete this polyline to start drawing it again, but without having to clear the map.
I now that with shape’s and marker’s is possible, but with Polyline I can’t get it.

Another ideia would you be create a event: When a Polyline has been started, to be possible measure lenght of the polyline when it has been started.

Thanks a lot bro

Hi @agrobusbrasil

So you should see the delete button appear within the drawing tools if you have it enabled, as shown here.

image

1 Like

The problem is… when I start create a polyline, even when to create a polygon, the Plugin dont give me a coordinates or Polyline ID to make a action… Its just possible do that when I select the polyline or when I close the polygon…

What is it you’re trying to do here? Are you attempting to use a polyline as a drawing tool by any chance? The polyline (like any shape) has to be completed before any coordinates are returned for it.

In desktop, the polyline tool work ok, cause you have a “mouse cursor” that indicate the polyline is not finished. But in mobile this “mouse cursor” doesn’t exist. So, the customer don’t know that need click again in the last Dot to close the polyline.

It would be interesting if in a creation, the polyline return coordinates and the ID an each click.

Ok, that’s a good point. I got around this problem before with the freehand drawing (polygons) options, as a similar thing happened.

I’ll have a look at what I can do here, run some tests on mobile then get back to you.

1 Like

Hi @agrobusbrasil

I’ve just pushed an update which changes how the measuring tool works. I think it works better than it did, but I’m not quite sure whether it will suit your needs for mobile as it’s pretty tricky to do. But give it a go and see how you get on with it, this is how it works now…

On desktop, when you enable it and click the map once, the first point is drawn. After that, just move the mouse around the map and the line will follow the mouse whilst updating the distance as it moves. Another click of the mouse will plot a new point and so forth. A double click on the line will end it. You cannot double click the map since the line follows the mouse, unlike mobile.

On mobile, when you enable it and tap the map once, the first point is drawn. After that, you can either tap on the map to move the line to that area, or you can drag with your finger which allows the line to follow your movement (like it would do with desktop). To plot a new point, you have to tap the last vertex of the polyline, and to end the measuring tool, you have to double click the last vertex of the polyline.

See how you get on with this. You will most likely want some popup on your page to show user’s how to use it. Be aware that dragging the map may cause page scrollbars to move also. When I try to disable this through events on the map, it causes other issues. There are ways round this.

Paul

1 Like

Hi Paul @pork1977gm. Is there any way to extract an image from the shape or marker to represent in a repeating group like the example below?

Hi, unfortunately there is no way to do that. I’d have to wrap my head around a way of doing it. Not too sure at the moment. I’m sure it would be possible but since the image you require consists of both the map and the shape (given the example screenshot) it would be tricky at best. I’ll give it some thought, but do a little research too if you can. If you spot anything/articles on the web that suggests it may be possible, fire them over to me and I’ll see.