Convert a Google Maps polygon path to an SVG path

前端 未结 2 1184
自闭症患者
自闭症患者 2020-12-18 16:18

When a user has drawn a polygon in Google Maps using the built in Drawing Manager I save the polygon path. I want to convert this polygon path to an SVG path so that I can r

2条回答
  •  Happy的楠姐
    2020-12-18 17:09

    Here is the basic HTML code for drawing polygon when you have set of points, you can embed this in a Javascript function and call with a map object.

    
    
    
    
    
    
    
    
     
    

    Here you can replace the x and y coordinates with variables for latitude and longitude for a particular location that the user has input in order to draw polygon on map.For example for the first point x1 = 200 and y1 = 10 and likewise.

    Hope this would help!!

提交回复
热议问题