如何在asp.net应用程序中添加更新Google Map选项 [英] how to add update Google Map option in asp.net application

查看:86
本文介绍了如何在asp.net应用程序中添加更新Google Map选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我必须为马拉松创建路线,为此我必须保留在地图上创建和更新路线的选项。所有逻辑应该只在应用程序内部吗?

请帮助我我如何开始工作?

在应用程序中我必须通过拖动和绘制功能绘制线条。



function initialize(){

var mapOptions = {

center:new google.maps.LatLng(-34.397,150.644),

zoom:8,
mapTypeId:google.maps.MapTypeId.ROADMAP

};



var map = new google.maps.Map( document.getElementById(''googleMap''),

mapOptions);



var drawingManager = new google.maps.drawing.DrawingManager( {

drawingMode:google.maps.drawing.OverlayType.MARKER,

drawingControl:true,

drawingControlOptions:{

位置:google.maps.ControlPosition.TOP_CENTER,

博士awingModes:[

google.maps.drawing.OverlayType.MARKER,

google.maps.drawing.OverlayType.CIRCLE,

google.maps .drawing.OverlayType.POLYGON,

google.maps.drawing.OverlayType.POLYLINE,

google.maps.drawing.OverlayType.RECTANGLE

]

},

markerOptions:{

icon:''images / beachflag.png''

} ,

circleOptions:{

fillColor:''#ffff00'',

fillOpacity:1,

strokeWeight :5,

可点击:false,

可编辑:true,

zIndex:1

}

});

drawingManager.setMap(map);

}



google。 maps.event.addDomListener(window,''load'',初始化);





在上面的代码中没有更新的选项或重置或编辑map.How我可以添加此代码中的功能?

In my application i have to create route for marathon and for that i have to keep option for creating and updating the route on map.All the logic should be inside application only ?
please help me how do i start to work?
In application i have to draw the line by drag and draw feature.

function initialize() {
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};

var map = new google.maps.Map(document.getElementById(''googleMap''),
mapOptions);

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,
google.maps.drawing.OverlayType.POLYGON,
google.maps.drawing.OverlayType.POLYLINE,
google.maps.drawing.OverlayType.RECTANGLE
]
},
markerOptions: {
icon: ''images/beachflag.png''
},
circleOptions: {
fillColor: ''#ffff00'',
fillOpacity: 1,
strokeWeight: 5,
clickable: false,
editable: true,
zIndex: 1
}
});
drawingManager.setMap(map);
}

google.maps.event.addDomListener(window, ''load'', initialize);


In above code there is no option to update or reset or edit map.How i can add these functionality in this code?

推荐答案

使用谷歌的方向API。



访问此链接:

https://developers.google.com/maps/documentation/directions/ [ ^ ]
Use google''s direction API.

visit this link:
https://developers.google.com/maps/documentation/directions/[^]

这篇关于如何在asp.net应用程序中添加更新Google Map选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆