Я использую карту Google в одном из своих проектов, в котором я создаю радиус вокруг текущего местоположения пользователя. Также пользователь должен иметь возможность увеличивать радиус круга по своему усмотрению.
то, что я смог сделать, это разместить еще один маркер, который при перетаскивании пользователем увеличивает радиус круга.
Но я хочу, чтобы была прокручиваемая полоса для увеличения радиуса круга. Поскольку она предоставит пользователю более удобный интерфейс для увеличения радиуса. любое предложение будет приветствоваться, мой код ниже
function init() {
var mapCenter = new google.maps.LatLng( 30.356625899999994, 78.08492950000004);
var map = new google.maps.Map(document.getElementById('map'), {
'zoom':12 ,
'center': mapCenter,
'mapTypeId': google.maps.MapTypeId.ROADMAP
});
// Create a draggable marker which will later on be binded to a
// Circle overlay.
var marker = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(30.356625899999994, 78.08492950000004),
draggable: true,
title: 'Drag me!'
});
// Add a Circle overlay to the map.
var circle = new google.maps.Circle({
map: map,
radius: 5000 // 5 km
});
// Since Circle and Marker both extend MVCObject, you can bind them
// together using MVCObject's bindTo() method. Here, we're binding
// the Circle's center to the Marker's position.
// http://code.google.com/apis/maps/documentation/v3/reference.html#MVCObject
circle.bindTo('center', marker, 'position');
}
// Register an event listener to fire when the page finishes loading.
google.maps.event.addDomListener(window, 'load', init);