Update v1.23.0
@court, @justinnnnnn, @renwagner
I’ve just pushed a huge update which has a lot of new additions and changes included, mainly around the geometry side of things. I’m pleased to get all these extra things in and I hope they’ll be of use. It’s taken some considerable time to make sure they all work as expected and all the calculations are correct and tested.
There’s been a significant increase to both the number of actions and exposed states in this update and because there’s essentially 2 ways you can draw shapes onto a map (through the tools or through the action) both ways now update the corresponding states accordingly. Marker’s should now always update the What 3 Word addresses when moved also.
I haven’t been able to complete all the requests that I’ve had yet, but I will get them included. I’m still working on this and have plans to get them all added.
The items I have left to work on are these:
the ability to select multiple map markers by drawing a shape over them - all markers within the boundaries of the drawn shape will go into a state of “list of markers” and you’ll be able to then save them or load them all in one action
make the selected shape’s border/stroke weight configurable
ability to add text to shapes drawn, need to think more about this
ability to add text at coordinates (like custom street names), also need to think about this
did we want to replace a marker with some sort of custom text control? might be easier to make up your own text within an image and use that as the map marker perhaps
rotating shapes… I’ve tested it and it looks awful, you don’t want it!
it’s not something that is supported but if you really want a way to do this then let me know
Here are the details…
New actions to the What3Words element
-
Measure length
Measures the total length between a pair of markers or points along a line. This action will populate the corresponding ‘Measured length’ exposed state with a value in the specified units.
-Shape type
Select the type of shape you want to measure the length for. Note: Selecting a circle will return the circumference. If you want to measure the distance between multiple markers, select Polyline.
-Coordinates
Use the various 'Drawing ... coordinates' states here to supply the coordinates needed for the shape selected.
-Units
Select the unit to measure the length in. Values are Meters, Miles and Kilometers.
-
Measure area
Measures the area of a shape and returns a value in square meters. This action will populate the corresponding ‘Measured area’ exposed state with a value in square meters.
-Shape type
Select the type of shape you want to measure the area for.
-Coordinates
Use the various 'Drawing ... coordinates' states here to supply the coordinates needed for the shape selected.
-
Center of shape
Returns the center coordinates of a shape. This action will populate the ‘Center coordinates’ exposed states with a set of latitude/longitude coordinates.
-Shape type
Select the type of shape you want to retrieve the center coordinates for.
-Coordinates
Use the various 'Drawing ... coordinates' states here to supply the coordinates needed for the shape selected.
Changes to existing actions
-
Draw shape
This action is responsible for drawing shapes onto the map without having to use the tools that appear on the map. It has a whole new section added to it that allows for a “buffer” area to be drawn around any shape within a specified number of meters.
.
These options will only be used when the ‘Generate buffer’ option below is set to Yes. Corners will be rounded to maintain the same distance from all sides and output will always be a polygon regardless of the initial shape selected.
.
-Generate buffer
Allows you to calculate a buffer (contingency area) around the shape which is essentially a second polygon that can be set to be X number of meters away from all sides. A positive number will calculate the buffer outwards by X meters, a negative number will calculate the size inwards by X meters.
-Distance
Enter a value in meters that is used to generate the buffer. Values can be positive or negative to determine the outward/inward distance from all sides.
-Fill color
Fill color for the buffer shape.
-Stroke weight
Stroke weight for the buffer shape in pixels.
-Stroke color
Stroke color for the buffer shape, this is the border.
-Editable
Make the buffer shape editable.
-Draggable
Make the buffer shape draggable.
-
‘Set marker’ and ‘Set list of markers’
Both these actions will now associate each marker with the click, hover and drag events which are responsible for updating each marker’s hovered, clicked, drawing coordinates and word states. Markers now have a draggable option associated to them (true/false).
-
Contains location
The exposed state called ‘Inside shape’ will be updated to Yes/No.
Previously this action would only determine if a marker was inside a polygon, this now applies to all shapes which includes polygons, rectangles and circles.
New exposed states
The following states have been added.
-
Drawing buffer rectangle coordinates
Contains a set of buffer coordinates that is generated when selecting a rectangle using the ‘Draw shape’ action and the generate buffer option is set to yes.
-
Drawing buffer circle coordinates
Contains a set of buffer coordinates that is generated when selecting a circle using the ‘Draw shape’ action and the generate buffer option is set to yes.
-
Drawing buffer polygon coordinates
Contains a set of buffer coordinates that is generated when selecting a polygon using the ‘Draw shape’ action and the generate buffer option is set to yes.
-
Drawing buffer polyline coordinates
Contains a set of buffer coordinates that is generated when selecting a polyline using the ‘Draw shape’ action and the generate buffer option is set to yes.
-
Measured area (polygon)
Contains an area measured in square meters of a polygon.
-
Measured area (rectangle)
Contains an area measured in square meters of a rectangle.
-
Measured area (circle)
Contains an area measured in square meters of a circle.
-
Measured length (polyline)
Contains the total length of a polyline.
-
Measured length (polygon)
Contains the total length of a polygon.
-
Measured length (rectangle)
Contains the total length of a rectangle.
-
Measured length (circle)
Contains the total length (circumference) of a circle.
-
Clicked map latitude
Contains the latitude coordinates when clicked anywhere on the map.
-
Clicked map longitude
Contains the longitude coordinates when clicked anywhere on the map.
-
Center coordinates (latitude)
Contains the center (latitude) coordinate for a shape.
-
Center coordinates (longitude)
Contains the center (longitude) coordinate for a shape.
-
Selected shape
Text value set to polygon, polyline, circle or rectangle depending on the shape selected.
Other changes
-
Zoom controls
Actions that have a zoom control now have 0 added to the list.
If 0 is selected then no zoom will happen.
-
State renames
Drawing clip to bounding box - renamed to: Drawing rectangle coordinates
Drawing clip to circle - renamed to: Drawing circle coordinates
Drawing clip to polygon - renamed to: Drawing polygon coordinates
Drawing clip to polyline - renamed to: Drawing polyline coordinates
Inside polygon - renamed to: Inside shape
If I’ve missed anything just let me know.
I haven’t decided yet but since I plan to add a lot more geometry calculations in within the near future and deal with as many requests as I can, the price may increase.
Paul