Google Map Drawing freehand

后端 未结 2 681
鱼传尺愫
鱼传尺愫 2021-01-31 06:21

\"enter

LATEST CODE - http://jsfiddle.net/YsQdh/88/ -

THIS VERSION USES gDouglasPe

2条回答
  •  走了就别回头了
    2021-01-31 07:00

    The latest answer - http://jsfiddle.net/YsQdh/94/

    This contains the gDouglasPeuker algorithm

    var theArrayofLatLng = path.j;
    var ArrayforPolygontoUse= GDouglasPeucker(theArrayofLatLng,50); 
    console.log("ArrayforPolygontoUse", ArrayforPolygontoUse);        
    
    
    var polyOptions = {
        map: map,
        fillColor: '#0099FF',
        fillOpacity: 0.7,
        strokeColor: '#AA2143',
        strokeWeight: 2,
        clickable: false,
        zIndex: 1,
        path:ArrayforPolygontoUse,
        editable: false
    }
    

提交回复
热议问题