示例#1
0
        public MapnikVectorTileProvider(string xmlConfig, Layer tileSource, int buffer, string pngOptions, string jpegOptions)
        {
            if (string.IsNullOrEmpty(xmlConfig))
            {
                throw new ArgumentNullException("MapnikVectorProvider xmlConfig cannot be null or empty");
            }

            if (tileSource == null )
            {
                throw new ArgumentNullException("MapnikVectorProvider tileSource cannot be null");
            }
            else
            {
                this._tileSource = tileSource;
            }

            // set jpegOptions
            if (jpegOptions == null)
            {
                this._jpegOptions = "jpeg";
            }
            else
            {
                this._jpegOptions = jpegOptions;
            }

            // set pngOptions
            if (pngOptions == null)
            {
                this._pngOptions = "png";
            }
            else
            {
                this._pngOptions = pngOptions;
            }

            this._map = new Map();
            _map.LoadMap(xmlConfig);
            this._map.Buffer = buffer;
        }
示例#2
0
 public MapnikVectorTileProvider(string xmlConfig, Layer tileSource)
     : this(xmlConfig, tileSource, 0, null, null)
 {
 }