Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
could you please tell how to add conditions in javascript for Google Map markers? when the parameters changes by query markers appear on map as query(filtered)?
Posted
Comments
kesav aggarwal 6-Dec-13 4:26am    
use jSon for making markers dynamically. Pass jSon data to jquery in google map api.
S.M.Arsalan 6-Dec-13 13:42pm    
sir i am using j son to view all events markers but i don't now how to filter it by j son? please tell me?
S.M.Arsalan 6-Dec-13 13:34pm    
sir i am using j son to view all events markers but i don't now how to filter it by j son? please tell me?

1 solution

Hi please use this for reference purpose in that HTML i have called initialize function on BODY load event so you should call that function and passing lat,long as per your condition using and control event.





<title>Simple markers

html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}




function initialize(l1,l2) {
var myLatlng = new google.maps.LatLng(l1,l2);
var mapOptions = {
zoom: 4,
center: myLatlng
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Hello World!'
});
}








 
Share this answer
 
Comments
Member 10378956 11-Dec-13 5:42am    
thats code r not working so correct ur code otherwise u have no right to send a code
S.M.Arsalan 11-Dec-13 16:01pm    
where can i put the conditions in j son? I have already made the c# function to call on j son in HTML but i don't know how to switch between those functions?

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