Example #1
0
 void aplicar()
 {
     NavigationPage.SetHasNavigationBar(this, ShowMap.showNavBar);
     map.BackgroundColor = Color.FromHex(ShowMap.colorBackgroundMap);
     if (ShowMap.useGoogleMaps)
     {
         map.TileLayers.Clear();
         map.MapType    = (ShowMap.typeMap == MapType.None)? MapType.Street : ShowMap.typeMap;
         MapaProvider   = GoogleMapsSelected;
         Attr.IsVisible = false;
     }
     else
     {
         map.TileLayers.Clear();
         var tiles = TileLayer.FromTileUri((int x, int y, int z) => new Uri($"" + ShowMap.MapProviderServer));
         MapaProvider   = OSMSelected;
         Attr.IsVisible = true;
         map.TileLayers.Add(tiles);
     }
     map.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(double.Parse(ShowMap.defaultPosition.Split(',')[0]), double.Parse(ShowMap.defaultPosition.Split(',')[1])), Distance.FromMeters(int.Parse(ShowMap.defaultPosition.Split(',')[2]))));
     map.UiSettings.MyLocationButtonEnabled = ShowMap.showMyLocation;
     Attr.Text = ShowMap.attrMap;
     map.UiSettings.ZoomControlsEnabled = ShowMap.showZoomMap;
     getServerData();
 }
        public void SetupMap()
        {
            double minLat = 50.0142652674738;
            double minLon = 19.6629558230123;
            double maxLat = 50.3237297996534;
            double maxLon = 21.127929227143;

            MyMap.MoveToRegion(MapSpan.FromBounds(
                                   new Bounds(new Position(minLat, minLon),
                                              new Position(maxLat, maxLon))),
                               true);

            if (linesTile != null)
            {
                MyMap.TileLayers.Remove(linesTile);
            }

            linesTile = TileLayer.FromTileUri((int x, int y, int zoom) =>
                                              new Uri(WMSTileProvider.GetTileUrl(x, y, zoom, "gaz%3Agaz-linie")));

            linesTile.Tag = "Gazociag"; // Can set any object
            MyMap.TileLayers.Add(linesTile);


            if (pointsTile != null)
            {
                MyMap.TileLayers.Remove(pointsTile);
            }

            pointsTile = TileLayer.FromTileUri((int x, int y, int zoom) =>
                                               new Uri(WMSTileProvider.GetTileUrl(x, y, zoom, "gaz%3Agaz-punkty")));

            pointsTile.Tag = "Punkty"; // Can set any object
            MyMap.TileLayers.Add(pointsTile);
        }
        public SecondPage()
        {
            InitializeComponent();

            var jgsLayer = TileLayer.FromTileUri((int x, int y, int zoom) =>
                                                 new Uri($"https://cyberjapandata.gsi.go.jp/xyz/std/{zoom}/{x}/{y}.png"));

            jgsLayer.Tag = "JGSITILE";         // Can set any object

            map.TileLayers.Add(jgsLayer);
            map.MapType = MapType.None;
        }
Example #4
0
        public TilesPage()
        {
            TileLayer objTile        = null;
            Button    currentDisable = buttonRemove;

            buttonRemove.IsEnabled = false;

            //Android
            var andString = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAQYklEQVR42u3dfYgex2HH8a/OT8VxHIcQyvUirkIoqiMOVZWDq6omdURqjGpUN3WFSF03pMGEpDRuk7ouuGnANUWYEooJIZhgShpUVzUmGOOaYpTUpHGipLYiO36RJTu2ZcvWiy3pdDrdm079Y/bss33PvTzP7uw8u98PDLKR7p7nmWf2tzOzs7OXoaXqAn4d+CNgHfAmcMFqKUUD2Ab8DnAZcAqYtlpUpJuA08ClrBwA1lst0S0Hvg5MZt/DOHBHFgpSIVYCR2cd/DNlb9YgFc9ns57X7O/hPLDGqlFRVgNn5wiAceAGqyea9U2C+EI2LJMKG//fM0fDuwQcBvqsoijfwQNNvoP7HQKoaEPA8SYNcLfVU7idTer+HHCV1aMYZ6C7gItzNMLTwGarqDArgUNNAmCPZ3/FMthkDHoJeBAnBItyp8GrVNzaJADGgRutntxtBk42qfNvWD2KrRt4pkmDPAQMWEW51vXDTer6LetaZbmBdxeiOCFYnF3z1PPtVo/KPDM9RPNZ6SGrqG19NJ/4ew5YZRWpTFfy3qXBs8vDhKsGat3XmtTtJM61KAFdhDXpc81OjwOftopaNjRPuD6S9cCk0q0GXmzSUJ+2m9qS5YR7LOaq07PAx62i9rlwIh/HCIuDvjVHl38I+AvgH0vomfQTFs+syMbSK7IDq+d93/0oMJaVkVn/PQa8DZwAJiK//+3A9U3+7t+Bx2127VtmFe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CSASDJAMhTapOAI34lgJOhBkAk076fJLlE2wCQZABIMgAca9aKtwMbALUca475lbwTzDIAahlIkgEQ8Yyb0tnGbq8MAA+42nM9hAHg2DeyYYPZAKjjmNtJQBkANT7jpjTxNl3T17YHYADY9S254ac07nYOwACoZWMbLXk4JAOgdk4l9F5OWw8yAOJ6M6H38naJr300oXpwJaABEM2LCY3/j5X4+s8m9J2ct1kaALE8SRqzzmeAIyXXw7FEvpNhm6ViWQ68AlwquTySQJDfkUA9PAP02ywV020lN/rzwNYE6qEfeLrEehgHdtkcFVsf8FiJDX93QnWxC7hQUj3sARo2R5VhPXA4coO/CNwHdCc2n3Q7MBm5Lg4Aq2yGKtNm4LmIB//9We8jNV3A3RFD4GfAWpufUrAG2JuNR4sc6+4GehOuh+XZ3Mi5AuthMusBDdrslFrj3wHsK+AsuB+4rkPGul3Ze32igIP/EHBjYsOfjrXMKihEAxgCtufQUCeA/wMep9w1/63oBj4ObMkhuEaAnwM/6cB6SNb/A5BKKSU8SJXFAAAAAElFTkSuQmCC";
            var andImage  = Convert.FromBase64String(andString.Split(",".ToCharArray(), 2)[1]);
            //Apple
            var appString = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAASQUlEQVR42u3dfZBeVX3A8W921+263W7jNk1pmomZqJmYiTHS8GKIaUSLNFIa0SJSYZRBy5Si0lZbHOgMwx8MoxQp06LT0oigtKLgtIIKyjvyJuHFQCCEgCRACHlZlnWTbLKb/nHOSoBN2Ow+z73n3Pv9zJxJhpnwPM+5v/O755x77jmTkPLSGct0YDZwUPzvPwUetXqkamkD5gGnACuAh4CXgD2vKXdaVeOrXCk1HcB84M+BY4FZQNcb/JvpVpuUr5bYpf8y8MAod/g3KuutQinPhr8AuBrYNo6GbwKQMh1+LgauBXZNoOGbAKTM7vhLgOuA7Q1o+CPlSatWStuceMcfamDDHykPWb1SmtqBzwHPN6Hhj5SbrWYpve7+4cA9TWz4I+Uqq/vAuQ5Azbzrnw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Nwu2Ex1YXEM5MbCuork4hnNa8hTwX+VyNj/r0GlNiTyCXSasLY6PvKKm+WgiPzP4WuCs2rNTrbSfwzyXWmRLXQjjd9fkEg3cLcC3hCUZHgvU2H7gIeCrRZPA4sAyX92oM5sVxdAqBuxr4MmHPwxyCdwph26xbgV2J3PUvAQ4yrHUgOmIgP1HCGPVFwtOJo8h3Br4tJtILYh0WnQy2Az8DFnnX10TvaGfT/PcIdsa75mcJLy9VSTdh3cW3af7OzbsIO/gchZvBqIF6gNMIs+47G3Sn3xYb/ZfihFp7xeuwJdbjCbGHs75BdbkzjvEviL0OG/4oXAfQuKHBIuDD8S4z5wACboDw/Plu4E7CTjPralyX3cACwlqMQ2Ljnc4bT3L2E06IfjTO1ayMZcDwNAEUqTMG7FzCJN1oG0cOE46SepqwTdlWDmxRTl20xPrrJEzYTYsJonOvRt8X63JTrMMBPCJ+zP4fl44XyBRTFr4AAAAASUVORK5CYII=";
            var appImage  = Convert.FromBase64String(appString.Split(",".ToCharArray(), 2)[1]);

            // ORM Tile
            buttonORMTile.Clicked += (sender, e) =>
            {
                if (objTile != null)
                {
                    map.TileLayers.Remove(objTile);
                }

                objTile = TileLayer.FromTileUri((int x, int y, int zoom) =>
                                                new Uri($"http://{"abc".Substring(new Random().Next(3), 1)}.tiles.openrailwaymap.org/standard/{zoom}/{x}/{y}.png")
                                                , 512);
                objTile.Tag = "ORMTILE"; // Can set any object

                map.TileLayers.Add(objTile);

                currentDisable.IsEnabled = true;
                currentDisable           = (Button)sender;
                currentDisable.IsEnabled = false;
            };

            // Japan GSI Tile
            buttonJGSITile.Clicked += (sender, e) =>
            {
                if (objTile != null)
                {
                    map.TileLayers.Remove(objTile);
                }

                objTile = TileLayer.FromTileUri((int x, int y, int zoom) =>
                                                new Uri($"https://cyberjapandata.gsi.go.jp/xyz/std/{zoom}/{x}/{y}.png"));
                objTile.Tag = "JGSITILE"; // Can set any object

                map.TileLayers.Add(objTile);

                currentDisable.IsEnabled = true;
                currentDisable           = (Button)sender;
                currentDisable.IsEnabled = false;
            };

            // Image Sync
            buttonSyncImage.Clicked += (sender, e) =>
            {
                if (objTile != null)
                {
                    map.TileLayers.Remove(objTile);
                }

                objTile     = TileLayer.FromSyncImage((int x, int y, int zoom) => andImage);
                objTile.Tag = "SYNCTILE"; // Can set any object

                map.TileLayers.Add(objTile);

                currentDisable.IsEnabled = true;
                currentDisable           = (Button)sender;
                currentDisable.IsEnabled = false;
            };

            // Image Async
            buttonAsyncImage.Clicked += (sender, e) =>
            {
                if (objTile != null)
                {
                    map.TileLayers.Remove(objTile);
                }

                objTile = TileLayer.FromAsyncImage(async(int x, int y, int zoom) =>
                {
                    return(await Task.Run(() =>
                    {
                        return appImage;
                    }));
                });
                objTile.Tag = "ASYNCTILE"; // Can set any object

                map.TileLayers.Add(objTile);

                currentDisable.IsEnabled = true;
                currentDisable           = (Button)sender;
                currentDisable.IsEnabled = false;
            };

            buttonRemove.Clicked += (sender, e) =>
            {
                map.TileLayers.Remove(objTile);
                objTile = null;

                currentDisable.IsEnabled = true;
                currentDisable           = (Button)sender;
                currentDisable.IsEnabled = false;
            };

            map.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(35.69d, 139.75d), Distance.FromMeters(10000)), false);
        }
Example #5
0
        public DefaultMapPage()
        {
            InitializeComponent();

            Map map = new Map();

            Pin pin1 = new Pin
            {
                Position = new Position(64.83d, -147.71d),
                Label    = "A Freaking Pin",
                Address  = "There will be things said here",
                Icon     = BitmapDescriptorFactory.FromBundle("Fifty.png")
            };
            Pin pin2 = new Pin
            {
                Type     = PinType.Place,
                Position = new Position(64.83d, -147.69d),
                Label    = "A Freaking Pin",
                Address  = "Maybe",
                Icon     = BitmapDescriptorFactory.FromBundle("OneHundred.png")
            };
            Pin pin3 = new Pin
            {
                Type     = PinType.Place,
                Position = new Position(64.83d, -147.73d),
                Label    = "A Freaking Pin",
                Address  = "Maybe",
                Icon     = BitmapDescriptorFactory.FromBundle("OneFifty.png")
            };

            Pin pin4 = new Pin
            {
                Type     = PinType.Place,
                Position = new Position(64.82d, -147.71d),
                Label    = "A Freaking Pin",
                Icon     = BitmapDescriptorFactory.FromBundle("TwoHundred.png")
            };
            Pin pin5 = new Pin
            {
                Type     = PinType.Place,
                Position = new Position(64.82d, -147.69d),
                Label    = "A Freaking Pin",
                Address  = "Maybe",
                Icon     = BitmapDescriptorFactory.FromBundle("ThreeHundred.png")
            };
            Pin pin6 = new Pin
            {
                Type     = PinType.Place,
                Position = new Position(64.82d, -147.73d),
                Label    = "A Freaking Pin",
                Address  = "Maybe",
                Icon     = BitmapDescriptorFactory.FromBundle("FiveHundred.png")
            };

            Pin pin7 = new Pin
            {
                Type     = PinType.Place,
                Position = new Position(64.81d, -147.73d),
                Label    = "A Freaking Pin",
                Address  = "Maybe",
                Icon     = BitmapDescriptorFactory.FromBundle("empty.png")
            };
            List <Pin> pins = new List <Pin> {
                pin1, pin2, pin3, pin4, pin5, pin6, pin7
            };

            foreach (var pin in pins)
            {
                map.Pins.Add(pin);
            }

            TileLayer tileLayer = TileLayer.FromTileUri((x, y, zoom) => new Uri($"https://uafbuenaire.azurewebsites.net/api/machinelearning/{zoom}/{x}/{y}"));

            map.TileLayers.Add(tileLayer);

            map.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(64.82d, -147.71d), Distance.FromMiles(1.0)));

            Content = map;
        }