public static Com.Mapbox.Mapboxsdk.Geometry.LatLngQuad ToNative(this LatLngQuad quad)
 {
     return(new Com.Mapbox.Mapboxsdk.Geometry.LatLngQuad(
                quad.TopLeft.ToLatLng(),
                quad.TopRight.ToLatLng(),
                quad.BottomRight.ToLatLng(),
                quad.BottomLeft.ToLatLng()
                ));
 }
Example #2
0
 public static MGLCoordinateQuad ToNative(this LatLngQuad quad)
 {
     return(new MGLCoordinateQuad
     {
         TopLeft = quad.TopLeft.ToCLCoordinate(),
         TopRight = quad.TopRight.ToCLCoordinate(),
         BottomRight = quad.BottomRight.ToCLCoordinate(),
         BottomLeft = quad.BottomLeft.ToCLCoordinate(),
     });
 }
        private void HandleStyleLoaded(MapStyle obj)
        {
            string ID_IMAGE_SOURCE = "animated_image_source";
            string ID_IMAGE_LAYER  = "animated_image_layer";

            LatLngQuad quad = new LatLngQuad(
                new LatLng(25.7836, -80.11725),
                new LatLng(25.783548, -80.1397431334),
                new LatLng(25.7680, -80.13964),
                new LatLng(25.76795, -80.11725)
                );

            // Add an ImageSource to the map
            var src = new MapboxImageSource(ID_IMAGE_SOURCE, quad, "miami_beach.png");

            map.Functions.AddSource(src);

            // Create a raster layer and use the imageSource's ID as the layer's data. Then add a RasterLayer to the map.
            map.Functions.AddLayer(new RasterLayer(ID_IMAGE_LAYER, ID_IMAGE_SOURCE));
        }
        private void HandleStyleLoaded(MapStyle obj)
        {
            string ID_IMAGE_SOURCE = "animated_image_source";
            string ID_IMAGE_LAYER  = "animated_image_layer";

            LatLngQuad quad = new LatLngQuad(
                new LatLng(46.437, -80.425),
                new LatLng(46.437, -71.516),
                new LatLng(37.936, -71.516),
                new LatLng(37.936, -80.425)
                );

            // Add an ImageSource to the map
            var src = new MapboxImageSource(ID_IMAGE_SOURCE, quad, "southeast_radar_0.png");

            map.Functions.AddSource(src);

            // Create a raster layer and use the imageSource's ID as the layer's data. Then add a RasterLayer to the map.
            map.Functions.AddLayer(new RasterLayer(ID_IMAGE_LAYER, ID_IMAGE_SOURCE));

            int i = 0;

            timer = new System.Threading.Timer(x =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    map.Functions?.UpdateSource(src.Id, $"southeast_radar_{i}.png");
                });
                i++;

                if (i > 3)
                {
                    i = 0;
                }
            }, i, 0, 100);
        }
Example #5
0
 public MapboxImageSource(string id, LatLngQuad coordinates, Xamarin.Forms.ImageSource source)
 {
     Id          = id;
     Coordinates = coordinates;
     Source      = source;
 }