Show polygon in Google Map - gists · GitHub

文章推薦指數: 80 %
投票人數:10人

Show polygon in Google Map. GitHub Gist: instantly share code, notes, and snippets. Skiptocontent Allgists BacktoGitHub Signin Signup Sign in Sign up {{message}} Instantlysharecode,notes,andsnippets. 567000/gist:9b19bbe0f75c77d65a2b CreatedMay6,2014 Star 1 Fork 1 Star Code Revisions 1 Stars 1 Forks 1 Embed Whatwouldyouliketodo? Embed Embedthisgistinyourwebsite. Share Copysharablelinkforthisgist. Clonevia HTTPS ClonewithGitorcheckoutwithSVNusingtherepository’swebaddress. LearnmoreaboutcloneURLs DownloadZIP ShowpolygoninGoogleMap Raw gistfile1.js ThisfilecontainsbidirectionalUnicodetextthatmaybeinterpretedorcompileddifferentlythanwhatappearsbelow.Toreview,openthefileinaneditorthatrevealshiddenUnicodecharacters. LearnmoreaboutbidirectionalUnicodecharacters Showhiddencharacters

varmap; functioninitialize(){ varmapOptions={ center:newgoogle.maps.LatLng(35.658028,139.751528), zoom:14, mapTypeId:google.maps.MapTypeId.ROADMAP }; map=newgoogle.maps.Map(document.getElementById("map_canvas"),mapOptions); vardata=[ newgoogle.maps.LatLng(35.658028,139.751528), newgoogle.maps.LatLng(35.657028,139.751528), newgoogle.maps.LatLng(35.657028,139.750528), newgoogle.maps.LatLng(35.658028,139.750528), ]; dataPolygon=newgoogle.maps.Polygon({ paths:data, strokeWeight:0, fillColor:'#FF0000', fillOpacity:0.35 }); dataPolygon.setMap(map); } google.maps.event.addDomListener(window,'load',initialize); Signupforfree tojointhisconversationonGitHub. Alreadyhaveanaccount? Signintocomment Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.


請為這篇文章評分?