/// <summary>
 /// Creates a new MapCSS scene target.
 /// </summary>
 /// <param name="mapCSSInterpreter"></param>
 /// <param name="scene"></param>
 /// <param name="projection"></param>
 public StyleOsmStreamSceneTarget(StyleInterpreter mapCSSInterpreter, 
     Scene2D scene, IProjection projection)
 {
     _projection = projection;
     _scene = scene;
     _mapCSSInterpreter = mapCSSInterpreter;
 }
Пример #2
0
        /// <summary>
        /// Adds a layer displaying osm data from a given data source using the given style.
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="styleInterpreter"></param>
        /// <returns></returns>
        public LayerOsm AddLayerOsm(IDataSourceReadOnly dataSource, StyleInterpreter styleInterpreter)
        {
            LayerOsm layerOsm = new LayerOsm(dataSource, styleInterpreter, this.Projection);

            this.AddLayer(layerOsm);
            return(layerOsm);
        }
Пример #3
0
 /// <summary>
 /// Creates a new MapCSS scene target.
 /// </summary>
 /// <param name="styleInterpreter"></param>
 /// <param name="scene"></param>
 /// <param name="projection"></param>
 public StyleOsmStreamSceneTarget(StyleInterpreter styleInterpreter,
                                  Scene2D scene, IProjection projection)
 {
     _projection       = projection;
     _scene            = scene;
     _styleInterpreter = styleInterpreter;
 }
Пример #4
0
        /// <summary>
        /// Adds a graph layer with the given data and style.
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="styleInterpreter"></param>
        /// <returns></returns>
        public LayerGraph AddLayerGraph(IRoutingAlgorithmData <Edge> dataSource,
                                        StyleInterpreter styleInterpreter)
        {
            var layerGraph = new LayerGraph(dataSource, styleInterpreter);

            this.AddLayer(layerGraph);
            return(layerGraph);
        }
Пример #5
0
 /// <summary>
 /// Creates a new MapCSS scene target.
 /// </summary>
 /// <param name="mapCSSInterpreter"></param>
 /// <param name="sceneStream"></param>
 /// <param name="scene"></param>
 /// <param name="projection"></param>
 public StyleOsmStreamSceneTarget(StyleInterpreter mapCSSInterpreter, Stream sceneStream,
                                  Scene2D scene, IProjection projection)
 {
     _projection        = projection;
     _scene             = scene;
     _sceneStream       = sceneStream;
     _mapCSSInterpreter = mapCSSInterpreter;
 }
Пример #6
0
        ///// <summary>
        ///// Adds a new scene layer with the given primitives source as it's source.
        ///// </summary>
        ///// <param name="scene"></param>
        ///// <returns></returns>
        //public LayerScene AddLayerScene(IScene2DPrimitivesSource scene)
        //{
        //    LayerScene layerScene = new LayerScene(scene);
        //    this.AddLayer(layerScene);
        //    return layerScene;
        //}

        /// <summary>
        /// Adds a graph layer with the given data and style.
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="styleInterpreter"></param>
        /// <returns></returns>
        public LayerDynamicGraphLiveEdge AddLayerGraph(IBasicRouterDataSource <LiveEdge> dataSource,
                                                       StyleInterpreter styleInterpreter)
        {
            LayerDynamicGraphLiveEdge layerGraph = new LayerDynamicGraphLiveEdge(dataSource, styleInterpreter);

            this.AddLayer(layerGraph);
            return(layerGraph);
        }
 /// <summary>
 /// Creates a new MapCSS scene target.
 /// </summary>
 /// <param name="styleInterpreter"></param>
 /// <param name="scene"></param>
 /// <param name="projection"></param>
 /// <param name="stream"></param>
 public StyleOsmStreamSceneStreamTarget(StyleInterpreter styleInterpreter,
     Scene2D scene, IProjection projection, Stream stream)
 {
     _projection = projection;
     _scene = scene;
     _styleInterpreter = styleInterpreter;
     _stream = stream;
 }
 /// <summary>
 /// Creates a new MapCSS scene target.
 /// </summary>
 /// <param name="styleInterpreter"></param>
 /// <param name="scene"></param>
 /// <param name="projection"></param>
 /// <param name="stream"></param>
 public StyleOsmStreamSceneStreamTarget(StyleInterpreter styleInterpreter,
                                        Scene2D scene, IProjection projection, Stream stream)
 {
     _projection       = projection;
     _scene            = scene;
     _styleInterpreter = styleInterpreter;
     _stream           = stream;
 }
Пример #9
0
        /// <summary>
        /// Creates a new OSM data layer.
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="styleInterpreter"></param>
        public LayerDynamicGraphLiveEdge(IBasicRouterDataSource <LiveEdge> dataSource,
                                         StyleInterpreter styleInterpreter)
        {
            _dataSource       = dataSource;
            _styleInterpreter = styleInterpreter;

            _scene = new Scene2D(new OsmSharp.Math.Geo.Projections.WebMercator(), 16);
            _interpretedObjects = new Dictionary <int, HashSet <ArcId> >();
        }
Пример #10
0
        /// <summary>
        /// Creates a new OSM data layer.
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="styleInterpreter"></param>
        public LayerGraph(IRoutingAlgorithmData <Edge> dataSource,
                          StyleInterpreter styleInterpreter)
        {
            _dataSource       = dataSource;
            _styleInterpreter = styleInterpreter;

            _scene = new Scene2D(new OsmSharp.Math.Geo.Projections.WebMercator(), 16);
            _interpretedObjects = new Dictionary <int, HashSet <ArcId> >();
        }
        /// <summary>
        /// Creates a new OSM data layer.
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="styleInterpreter"></param>
        public LayerDynamicGraphLiveEdge(IBasicRouterDataSource <LiveEdge> dataSource,
                                         StyleInterpreter styleInterpreter)
        {
            _dataSource       = dataSource;
            _styleInterpreter = styleInterpreter;

            this.Scene          = new Scene2DSimple();
            _interpretedObjects = new Dictionary <int, HashSet <ArcId> >();
            this.Cache          = false;
        }
Пример #12
0
        public static RenderingInstance Build(OsmStreamSource streamSource, StyleInterpreter interpreter)
        {
            var instance = new RenderingInstance();

            MemoryDataSource dataSource = MemoryDataSource.CreateFrom(streamSource);

            instance.Map.AddLayer(new LayerOsm(dataSource, interpreter, instance.Map.Projection));

            return(instance);
        }
Пример #13
0
        /// <summary>
        /// Creates a new OSM data layer.
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="styleInterpreter"></param>
        /// <param name="projection"></param>
        public LayerOsm(IDataSourceReadOnly dataSource, StyleInterpreter styleInterpreter, IProjection projection)
        {
            // build the zoom-level cutoffs.
            List <float> zoomFactors = new List <float>();

            zoomFactors.Add(16);
            zoomFactors.Add(14);
            zoomFactors.Add(12);
            zoomFactors.Add(10);

            _dataSource        = dataSource;
            _styleSceneManager = new StyleSceneManager(styleInterpreter, projection, zoomFactors);
        }
Пример #14
0
        /// <summary>
        /// Creates a new OSM data layer.
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="styleInterpreter"></param>
        public OsmLayer(IDataSourceReadOnly dataSource, StyleInterpreter styleInterpreter, IProjection projection)
        {
            // build the zoom-level cutoffs.
            List <float> zoomLevelCutoffs = new List <float>();

            zoomLevelCutoffs.Add((float)projection.ToZoomFactor(18));
            zoomLevelCutoffs.Add((float)projection.ToZoomFactor(16));
            zoomLevelCutoffs.Add((float)projection.ToZoomFactor(14));
            zoomLevelCutoffs.Add((float)projection.ToZoomFactor(12));
            zoomLevelCutoffs.Add((float)projection.ToZoomFactor(10));
            zoomLevelCutoffs.Add((float)projection.ToZoomFactor(8));

            _dataSource        = dataSource;
            _styleSceneManager = new StyleSceneManager(styleInterpreter, zoomLevelCutoffs);
        }
Пример #15
0
 /// <summary>
 /// Creates a new style osm stream interpreter.
 /// </summary>
 /// <param name="styleInterpreter"></param>
 public StyleOsmStreamFilter(StyleInterpreter styleInterpreter)
     :base(new OsmSharp.Osm.Cache.OsmDataCacheMemory())
 {
     _styleInterpreter = styleInterpreter;
 }
Пример #16
0
 /// <summary>
 /// Creates a new style osm stream interpreter.
 /// </summary>
 /// <param name="styleInterpreter"></param>
 public StyleOsmStreamFilter(StyleInterpreter styleInterpreter)
     : base(new OsmSharp.Osm.Cache.OsmDataCacheMemory())
 {
     _styleInterpreter = styleInterpreter;
 }