function MarkerLayer(map,opt_opts){this.map=map;this.markers=new Array;this.mgr=new MarkerManager(map,{maxZoom:19});this.enabled=false;this.pids={};GEvent.addListener(map,"moveend",function(){if(this.enabled){var bounds=map.getBounds();var southWest=bounds.getSouthWest();var northEast=bounds.getNorthEast();}});}
MarkerLayer.prototype.clearMarker=function(){this.markers=new Array;this.mgr.clearMarkers();this.mgr.refresh();this.pids={};}
MarkerLayer.prototype.enable=function(){this.enabled=true;}
MarkerLayer.prototype.disable=function(){this.enabled=false;this.mgr.clearMarkers();this.markers=new Array;this.pids={};}
MarkerLayer.prototype.getEnabled=function(){return this.enabled;}
MarkerLayer.prototype.parseData=function(json){this.clearMarker();this.mgr.clearMarkers();var batch=[];for(i=0;i<json.length;i++)
{var place=json[i];if(this.pids[place.pid]!=1)
{var marker=this.createMarker(place);marker.placename=place.placename;this.markers.push(marker);this.pids[place.pid]=1;batch.push(marker);}}
this.mgr.addMarkers(batch,0);this.mgr.refresh();}
MarkerLayer.prototype.createMarker=function(place){var marker=new GMarker(new GLatLng(place.geoy,place.geox),{title:place.placename});marker.pid=place.pid;GEvent.addListener(marker,"click",function(){if(marker.html==null)
{var queryURL="/datasource/getplaceinfo.php?datatype="+Wuwoo.current_datatype.id+"&pid="+escape(place.pid)+"&lang="+Wuwoo.current_lang;jQuery.ajax({type:"GET",url:queryURL,data:{},success:function(response){marker.html=Wuwoo.current_datatype.get_info_html(place.pid,place.placename,response);Wuwoo.removeProgressIndicator($("#data_infowindow_body"));marker.openInfoWindowHtml(marker.html);Wuwoo.addProgressIndicator($("#data_infowindow_body"));},error:function(response){Wuwoo.removeProgressIndicator($("#data_infowindow_body"));}});}
else
{marker.openInfoWindowHtml(marker.html);}});return marker;}
MarkerLayer.prototype.updateMarkerPositions=function(maptype)
{var offsetX=0;var offsetY=0;if(maptype==0)
{offsetX=0.0018;offsetY=0.0069;}
else
{offsetX=-0.0018;offsetY=-0.0069;}
for(i=0;i<this.markers.length;i++)
{var oldgeo=this.markers[i].getLatLng();this.markers[i].setLatLng(new GLatLng(oldgeo.lat()+offsetX,oldgeo.lng()+offsetY));}}
MarkerLayer.prototype.getMarker=function(pid)
{for(i=0;i<this.markers.length;i++)
{if(this.markers[i].pid==pid)
{return this.markers[i];}}}