Xamarin.Forms调用OpenStreetMap离线地图

            var map = new Mapsui.Map
           {
            Transformation = new MinimalTransformation(),
            CRS = "EPSG:3857",
            BackColor = Mapsui.Styles.Color.Gray
        };


        var attribution = new BruTile.Attribution("© OpenStreetMap contributors",
            "http://www.openstreetmap.org/copyright");


        var tileSource = new HttpTileSource(new GlobalSphericalMercator(),
            "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",
            new[] { "a", "b", "c" }, name: "OpenStreetMap",
            attribution: attribution);

        var tileLayer = new TileLayer(tileSource) { Name = "Carto Light" };


        map.Layers.Add(tileLayer);

  

posted @ 2020-08-14 14:32  解落三秋叶  阅读(282)  评论(0)    收藏  举报