Draw Custom Shapes Using Google Maps API
When I first saw the ‘Draw-a-search’ feature on the Rightmove website a few years ago I was impressed. It was a method of searching that I hadn’t seen before and provided the user with a visual concept of filtering results. Three years on from it’s original creation and my thoughts on this feature remain the same.
What’s this got to do with drawing custom shapes? Well, I have just one niggle with the feature in that, whilst creating my shape I found my self clicking, and clicking a lot. To create even a basic shape avoiding and including certain areas warranted at least 10 clicks. As a result I set to work on my own ‘Draw-a-search’ feature that requires just two clicks and allows you to draw the most complex shapes. The rest is done by simply dragging the mouse around the required area and, when done, simply click again to close the shape off.
Let’s take a look at it in action.
How to use: Click once to begin the shape, move the mouse, and click again to finish. Don’t keep mouse button clicked
Click here to view a full screen version and to download the source code.