//public MapTileVectorDataSource(string url)
        //{
        //    Uri = url;
        //    _geoStream = new FileStream(url, FileMode.Open);
        //    byte[] bufferGeo = new byte[_geoStream.Length];
        //    _geoStream.Read(bufferGeo, 0, bufferGeo.Length);
        //    _geoStream.Close();
        //    MemoryStream baisGeo = new MemoryStream(bufferGeo);
        //    _getSet = new GeoSet(new BinaryReader(baisGeo));
        //    string filePath = Path.GetDirectoryName(url);
        //    string[] layerNames = _getSet.GetLayerNames();
        //    _layerStreams = new FileStream[layerNames.Length];
        //    for (int i = 0; i < layerNames.Length; i++)
        //    {
        //        string layerName = filePath + "\\" + layerNames[i];
        //        _layerStreams[i] = new FileStream(layerName, FileMode.Open);
        //        MapFeatureLayer layer = new MapFeatureLayer(new BinaryReader(_layerStreams[i]));
        //        layer.FontColor = 0x000000;
        //        GeoSet.MapFeatureLayerInfo layerInfo = _getSet.GetMapMapFeatureLayerInfo(layerNames[i]);
        //        if (layerInfo != null)
        //        {
        //            layer.ZoomLevel = layerInfo.ZoomLevel;
        //            layer.ZoomMin = layerInfo.ZoomMin;
        //            layer.ZoomMax = layerInfo.ZoomMax;
        //            layer.Description = layerInfo.Description;
        //            layer.Visible = layerInfo.Visible;
        //            layer.LayerName = layerInfo.LayerName;
        //        }
        //        _getSet.AddMapFeatureLayer(layer);
        //    }
        //    _vectorMapRenderer = new VectorMapRenderer(_getSet);
        //    Font font = new Font(FontFamily.GenericSansSerif, 13, FontStyle.Regular);
        //    IFont newFont = MapLayer.GetAbstractGraphicsFactory().CreateFont(font);
        //    _vectorMapRenderer.SetFont(newFont);
        //    _getSet.Open();
        //}
        public MapTileVectorDataSource(string url)
        {
            Uri = url;
            _geoStream = new FileStream(url, FileMode.Open);
            byte[] bufferGeo = new byte[_geoStream.Length];
            _geoStream.Read(bufferGeo, 0, bufferGeo.Length);
            _geoStream.Close();
            MemoryStream baisGeo = new MemoryStream(bufferGeo);
            _getSet = new GeoSet();
            string filePath = @"C:\shenjing\map";
            string[] layerNames = new string[] {"3.lyr","1.lyr", "2.lyr" };
            _layerStreams = new FileStream[layerNames.Length];
            for (int i = 0; i < layerNames.Length; i++)
            {
                string layerName = filePath + "\\" + layerNames[i];
                _layerStreams[i] = new FileStream(layerName, FileMode.Open);
                MapFeatureLayer layer = new MapFeatureLayer(new BinaryReader(_layerStreams[i]));
                layer.FontColor = 0x000000;
                GeoSet.MapFeatureLayerInfo layerInfo = _getSet.GetMapMapFeatureLayerInfo(layerNames[i]);
                if (layerInfo != null)
                {
                    layer.ZoomLevel = layerInfo.ZoomLevel;
                    layer.ZoomMin = layerInfo.ZoomMin;
                    layer.ZoomMax = layerInfo.ZoomMax;
                    layer.Description = layerInfo.Description;
                    layer.Visible = layerInfo.Visible;
                    layer.LayerName = layerInfo.LayerName;
                }
                _getSet.AddMapFeatureLayer(layer);
            }

            _vectorMapRenderer = new VectorMapRenderer(_getSet);
            Font font = new Font(FontFamily.GenericSansSerif, 13, FontStyle.Regular);
            IFont newFont = MapLayer.GetAbstractGraphicsFactory().CreateFont(font);
            _vectorMapRenderer.SetFont(newFont);
            _getSet.Open();
        }
Exemplo n.º 2
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 21JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Constrcutor.
  * @param geoSet
  */
 public VectorMapRenderer(GeoSet geoSet)
 {
     _geoSet = geoSet;
     _vectorMapCanvas = new VectorMapNativeCanvas();
 }
Exemplo n.º 3
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 21JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Set a new geoset for this vector map.
         * @param geoSet a new geoset.
         */
        public void SetGeoSet(GeoSet geoSet)
        {
            _geoSet = geoSet;
        }
Exemplo n.º 4
0
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 21JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * default constructor.
         * @param Width the Width of the map.
         * @param Height the Height of the map.
         * @param mapTileDownloadManager map download manager.
         * @param geoSet geoset instance.
         * @throws InvalidLicenceException
         */
        public VectorMap(int width, int height,
                         MapTileDownloadManager mapTileDownloadManager, GeoSet geoSet)
            : base(width, height, mapTileDownloadManager)
        {
            _geoSet = geoSet;
        }
Exemplo n.º 5
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 21JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * default constructor.
  * @param Width the Width of the map.
  * @param Height the Height of the map.
  * @param mapTileDownloadManager map download manager.
  * @param geoSet geoset instance.
  * @throws InvalidLicenceException
  */
 public VectorMap(int width, int height,
         MapTileDownloadManager mapTileDownloadManager, GeoSet geoSet)
     : base(width, height, mapTileDownloadManager)
 {
     _geoSet = geoSet;
 }
Exemplo n.º 6
0
 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 21JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Set a new geoset for this vector map.
  * @param geoSet a new geoset.
  */
 public void SetGeoSet(GeoSet geoSet)
 {
     _geoSet = geoSet;
 }
        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 21JUN2009  James Shen                              Initial Creation
        ////////////////////////////////////////////////////////////////////////////

        /**
         * Constrcutor.
         * @param geoSet
         */
        public VectorMapRenderer(GeoSet geoSet)
        {
            _geoSet          = geoSet;
            _vectorMapCanvas = new VectorMapNativeCanvas();
        }