Exemplo n.º 1
0
        private void HandleOnlineOffline()
        {
            if (btnOnlineOffline.Text == "Online")
            {
                btnOnlineOffline.Text = "Offline";
                map.AddLayerTile();
            }
            else
            {
                btnOnlineOffline.Text = "Online";

                // Get assembly
                var assembly = typeof(OsmMap).GetTypeInfo().Assembly;

                // Initialize the data source.
                var stream = assembly.GetManifestResourceStream("OsmSharp.Forms.Maps.test.osm.pbf");

                map.AddLayerOsm(stream);
            }
        }
Exemplo n.º 2
0
        private void HandleOnlineOffline()
        {
            if (btnOnlineOffline.Text == "Online")
            {
                btnOnlineOffline.Text = "Offline";
                map.MapType           = MapType.Street;
            }
            else
            {
                btnOnlineOffline.Text = "Online";

                // Get assembly
                var assembly = typeof(App).GetTypeInfo().Assembly;

                // Initialize the data source.
                var cssStream = assembly.GetManifestResourceStream("OsmSharp.Forms.Demo.MapCSS.Default.mapcss");
                var stream    = assembly.GetManifestResourceStream("OsmSharp.Forms.Demo.Maps.test.osm.pbf");

                map.AddLayerOsm(stream, cssStream);
            }
        }