我嘗試使用谷歌地圖API V3,但我一直錯誤谷歌地圖API V3的DrawingManager沒有工作
我加在網頁腳本:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=drawing"></script>
,我已經執行:
var drawingManager = new google.maps.drawing.DrawingManager({
drawingMode: google.maps.drawing.OverlayType.MARKER,
drawingControl: true,
drawingControlOptions: {
position: google.maps.ControlPosition.TOP_CENTER,
drawingModes: [google.maps.drawing.OverlayType.MARKER, google.maps.drawing.OverlayType.CIRCLE]
},
/*markerOptions: {
icon: new google.maps.MarkerImage('http://www.example.com/icon.png')
},*/
circleOptions: {
fillColor: '#ffff00',
fillOpacity: 1,
strokeWeight: 5,
clickable: false,
zIndex: 1,
editable: true
}
我總是相同的錯誤:
Uncaught TypeError: Cannot read property 'DrawingManager' of undefined
這將是巨大的,如果你能提供一個解釋爲好。 – asheeshr 2012-12-27 10:29:20