Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How i add my own image or drawing option on google map drawing

I want to add my own button to enable my feature in Google map drawing.

Here is the link for the sample drawing page Google Developers Drawing tools Here you can see 6 options for drawing.

I want to add my option in these 6 option, How can I do that?

like image 314
Mangita Avatar asked May 23 '14 11:05

Mangita


People also ask

Can we customize your own Google map?

Change how a map looks Open a map you can edit or create a map. To choose a style, click one of the images.

How do I create my own map in Google Maps?

Open Google Maps and click the menu button in the top left corner. Click Your Places > Maps > Create Map. Name your map and enter in a description. Add markers for your desired locations.

Can you add images to Google My Maps?

On your computer, open Google Maps. Your contributions. Under the "Contribute" tab, click Add your photos to Maps. You only get this option if you take photos on your phone and we can find their location.


1 Answers

Start by adding your own button in HTML

<button id="custom-BtnPolygon">Draw</button>
<button id="custom-BtnPolyline">Draw</button>

and call it from your javascript to invoke google drawingManager

$("#custom-BtnPolygon").click( function(){
      drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYGON);
 });

$("#custom-BtnPolyline").click( function(){
      drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYLINE);
 });

Initiate polygon drawing from custom button

like image 72
krispymallows Avatar answered Sep 27 '22 21:09

krispymallows