예제 #1
0
        public async Task <bool> Handle(GetMapEventsUseCaseRequest message, IOutputPort <GetMapEventUseCaseResponse> outputPort)
        {
            var coordinate = await _mapRepository.GetAll();

            outputPort.Handle(new GetMapEventUseCaseResponse(coordinate.MapEvents, null, true, "Map Event get all Complete"));
            return(true);
        }
예제 #2
0
        /// <summary>
        /// 刷新地图
        /// </summary>
        /// <param name="mapId">地图编号</param>
        /// <returns></returns>
        public bool RefreshMap(string mapId, string user)
        {
            var query = from a in _IMapReleationRepository.GetAll()
                        join b in _ILayerContentRepository.GetAll() on a.DataConfigID equals b.Id
                        join c in _IMapRepository.GetAll() on a.MapID equals c.Id
                        where a.MapID == mapId
                        orderby a.DataSort
                        select new
            {
                a.Id,
                b.LayerAttrTable,
                c.MapEnName
            };

            var query2 = from a in _IMapReleationRepository.GetAll()
                         join b in _IDataStyleRepository.GetAll() on a.DataStyleID equals b.Id
                         select new
            {
                a.Id,
                b.StyleName
            };
            var           list         = query2.ToList();
            List <string> targetLayers = new List <string>();
            List <string> styleLayers  = new List <string>();
            string        mapName      = string.Empty;

            foreach (var item in query)
            {
                targetLayers.Add(item.LayerAttrTable);
                var style = list.Find(t => t.Id == item.Id);
                if (style != null)
                {
                    styleLayers.Add(style.StyleName);
                }
                else
                {
                    styleLayers.Add(string.Empty);
                }
                mapName = item.MapEnName;
            }

            var             map     = _IMapRepository.Get(mapId);
            GeoServerHelper geoHelp = new GeoServerHelper();

            geoHelp.AddLayerGroup(mapName, targetLayers, styleLayers);
            geoHelp.TerminatingTask(mapName);
            geoHelp.TileMap(map.MapEnName);

            #region [生成缩略图]

            string strBBox = map.MinX.ToString() + "," + map.MinY.ToString() + "," + map.MaxX.ToString() + "," + map.MaxY.ToString();
            GetThumbnial(map.MapEnName, strBBox);

            #endregion

            _IOperateLogAppService.WriteOperateLog(mapId, user, 1002, 1106, 1201, 1451, null);
            return(true);
        }
예제 #3
0
 /// <summary>
 /// 验证是否有重复地图名称
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public bool GetMapNameExist(string name)
 {
     try
     {
         var entity = _IMapRepository.GetAll().Where(q => q.MapName == name).ToList();
         if (entity.Count > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
        public ActionResult Index()
        {
            var maps = _mapRepository.GetAll();

            return(View(maps));
        }
예제 #5
0
 public IEnumerable <Map> GetAllMaps()
 {
     return(Repository.GetAll());
 }
예제 #6
0
 public async Task <IEnumerable <Map> > GetAll()
 {
     return(await _mapRepository.GetAll());
 }
예제 #7
0
 public Map[] GetAllMaps() => _mapRepository.GetAll();