首页 > 代码库 > 拖动地图时,只有相隔一定时间才从服务端取数据

拖动地图时,只有相隔一定时间才从服务端取数据


- (void)mapView:(MAMapView *)mapView regionDidChangeAnimated:(BOOL)animated

{

       SEL getMapSelector = @selector(getMapData);

        [NSObjectcancelPreviousPerformRequestsWithTarget:selfselector:getMapSelector object:nil];

        [selfperformSelector:getMapSelector withObject:nilafterDelay:0.5];

}

拖动地图时,只有相隔一定时间才从服务端取数据