ClearCache() public method

清除指定地图范围的缓存。
public ClearCache ( string mapName, Rectangle2D bounds ) : bool
mapName string 地图名称。
bounds Rectangle2D 地图范围。
return bool
コード例 #1
0
 public void ClearCache_NoBounds()
 {
     Map map = new Map("http://" + ip + ":8090/iserver/services/map-world/rest");
     try
     {
         bool succeed = map.ClearCache("世界地图", null);
     }
     catch (ArgumentNullException e)
     {
         Assert.IsTrue(string.Equals("bounds", e.ParamName));
     }
 }
コード例 #2
0
 public void ClearCache_CustomExtend()
 {
     Map map = new Map("http://" + ip + ":8090/iserver/services/map-world/rest");
     string mapName = "世界地图";
     Rectangle2D clearCacheBounds = new Rectangle2D(0, 0, 180, 90);
     bool succeed = map.ClearCache(mapName, clearCacheBounds);
     Assert.IsTrue(succeed);
 }
コード例 #3
0
 public void ClearCache_NoMapName()
 {
     Map map = new Map("http://" + ip + ":8090/iserver/services/map-world/rest");
     Rectangle2D clearCacheBounds = new Rectangle2D(0, 0, 180, 90);
     try
     {
         bool succeed = map.ClearCache(null, clearCacheBounds);
     }
     catch (ArgumentNullException e)
     {
         Assert.IsTrue(string.Equals("mapName", e.ParamName));
     }
 }
コード例 #4
0
 public void ClearCache_FullExtend()
 {
     Map map = new Map("http://" + ip + ":8090/iserver/services/map-world/rest");
     string mapName = "世界地图1";
     Rectangle2D clearCacheBounds = new Rectangle2D(-180, -90, 180, 90);
     try
     {
         bool succeed = map.ClearCache(mapName, clearCacheBounds);
     }
     catch (ServiceException exception)
     {
         string message = exception.Message;
         Assert.IsTrue("地图 世界地图1 不存在,获取相应的地图业务组件失败" == exception.Message);
         Assert.IsTrue(404 == exception.Code);
     }
 }