2013-07-12 2 views
0

Json 파일의지도 표시자를 어떻게 필터링 할 수 있습니까?gmap 표시 자 필터링 방법?

 
$(function() { 

       demo.add(function() { 
        $('#map_canvas').gmap({'disableDefaultUI':false, 'callback': function() { 

         var self = this; 
         $.getJSON('demo.asp', function (data) { 
          $.each(data.markers, function(i, marker) { 
           self.addMarker({ 'position': new google.maps.LatLng(marker.latitude, marker.longitude), 'bounds':true }).click(function() { 
            self.openInfoWindow({ 'content': marker.content }, this); 
           }); 
          }); 
         }); 
        }}); 
       }).load(); 
      }); 

답변

0
$(function() { 

       demo.add(function() { 
        $('#map_canvas').gmap({'disableDefaultUI':false, 'callback': function() { 

         var self = this; 
         $.getJSON('demo.asp', function (data) { 
          $.each(data.markers, function(i, marker) { 
          if(marker!="filtered data"){ 

           self.addMarker({ 'position': new google.maps.LatLng(marker.latitude, marker.longitude), 'bounds':true }).click(function() { 
            self.openInfoWindow({ 'content': marker.content }, this); 
          } 
           }); 
          }); 
         }); 
        }}); 
       }).load(); 
      }); 

당신이 그것을 필터링, 또는 JSON 데이터를 가져 논리에를 필터링 할 수 있습니다.

+0

감사의 찬성! –

+0

을 클릭하면 위 또는 아래로 투표 할 수있는 위치의 확인란을 클릭하는 데 도움이되는 경우 도움이됩니다. – prospector