Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?
Posted
Updated 27-Apr-13 1:29am
v2
Comments
ZurdoDev 26-Apr-13 11:49am    
Start by using the google map api.
sagmali 26-Apr-13 12:34pm    
how to add drag and draw functionality in application

1 solution

Use google's direction API.

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900