i am calling initialize function on parks tag class then club tag class then map reload again i want to stop map reload and print parks when click on parks class and print clubs when click clubs class.the same functionality works on some other types.
function initialize(lat, lon, typ) {
var pyrmont = new google.maps.LatLng(lat,lon);
map = new google.maps.Map(document.getElementById('map'), {
center: pyrmont,
zoom: 15
});
//var latlng = new google.maps.LatLng(-24.397, 140.644);
var request = {
location: pyrmont,
radius: 400,
types: [typ]
};
infowindow = new google.maps.InfoWindow();
var service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);
var myCity = new google.maps.Circle({
center: pyrmont,
radius: 500,
strokeColor: "#0000FF",
strokeOpacity: 0.8,
strokeWeight: 1,
fillColor: "#0000FF",
fillOpacity: 0.1,
editable: true
});
myCity.setMap(map);
}
function callback(results, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
createMarker(results[i]);
}
}
}
function createMarker(place) {
var placeLoc = place.geometry.location;
var marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
icon:'icone/'+typ+'.png',
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}