Skip to content
This repository was archived by the owner on Sep 3, 2019. It is now read-only.
This repository was archived by the owner on Sep 3, 2019. It is now read-only.

Questions: Will this render maps from osm.pbf #284

Description

@longlostbro

Is it possible to render an entire map with roads, highways, land, water, pois and everything from an osm.pbf?
I tried this example and it doesn't display anything on the map

        //initialize map.
        var map = new OsmSharp.UI.Map.Map(new WebMercator());

        // create the MapCSS image source.
        var imageSource = new MapCSSDictionaryImageSource();
        // initialize mapcss interpreter.
        var mapCssInterpreter = new MapCSSInterpreter(File.OpenRead(@"data\default.mapcss"), imageSource);
        
        var source = MemoryDataSource.CreateFromPBFStream(File.OpenRead(@"osm.pbf"));
        var testLayer = new LayerOsm(source, mapCssInterpreter,new WebMercator());
        map.AddLayer(testLayer);
        MapControl.SuspendNotifyMapViewChanged();

        //  set control properties.
        MapControl.MapZoom = 14;
        MapControl.Map = map;
        MapControl.MapCenter = testLayer.Envelope.Center;
        MapControl.ResumeNotifyMapViewChanged();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions