Example #1
0
        public new Map Load(string fileName, IProgressIndicator progress, object userInfo)
        {
            //    LogFactory.WriteLogEntry(Logger.Default, string.Format("Loading CartoCSS project from '{0}' ...", fileName), LogEntryType.Information);

            CartoProject cartoProject = CartoProject.FromFile(File.ReadAllText(fileName), Path.GetExtension(fileName));

            return(CartoProcessor.GetMap(cartoProject, Path.GetDirectoryName(fileName), progress));
        }
Example #2
0
        protected override Map OnLoad(Stream input, IProgressIndicator progress, object userInfo)
        {
            object[] objArray = (object[])userInfo;
            string   fileName = (string)objArray[0];

//      LogFactory.WriteLogEntry(Logger.Default, string.Format("Loading CartoCSS project from '{0}' ...", fileName), LogEntryType.Information);

            using (StreamReader sr = new StreamReader(input))
            {
                CartoProject cartoProject = CartoProject.FromFile(sr.ReadToEnd(), Path.GetExtension(fileName));
                return(CartoProcessor.GetMap(cartoProject, Path.GetDirectoryName(fileName), progress));
            }
        }