@@ -1453,48 +1453,33 @@ impl Mapbox {
1453
1453
}
1454
1454
}
1455
1455
1456
- #[ derive( Serialize , Clone , Debug ) ]
1457
- #[ serde( rename_all = "kebab-case" ) ]
1458
- pub enum MapboxStyle {
1459
- #[ serde( rename = "carto-darkmatter" ) ]
1460
- CartoDarkMatter ,
1461
- CartoPositron ,
1462
- OpenStreetMap ,
1463
- StamenTerrain ,
1464
- StamenToner ,
1465
- StamenWatercolor ,
1466
- WhiteBg ,
1467
- Basic ,
1468
- Streets ,
1469
- Outdoors ,
1470
- Light ,
1471
- Dark ,
1472
- Satellite ,
1473
- SatelliteStreets ,
1474
- }
1475
-
1476
1456
#[ derive( Serialize , Clone , Debug , FieldSetter ) ]
1477
1457
pub struct Geo {
1478
- /// Sets the geo access token to be used for this geo map. Note that
1479
- /// `access_token`s are only required when `style` (e.g with values: basic,
1480
- /// streets, outdoors, light, dark, satellite, satellite-streets)
1481
- /// and/or a layout layer references the Mapbox server.
1482
- #[ serde( rename = "accesstoken" ) ]
1483
- access_token : Option < String > ,
1484
- /// Sets the bearing angle of the map in degrees counter-clockwise from
1485
- /// North.
1486
- bearing : Option < f64 > ,
1487
- /// Sets the latitude and longitude of the center of the map.
1488
- center : Option < Center > ,
1489
- /// Sets the domain within which the mapbox will be drawn.
1490
- domain : Option < Domain > ,
1491
- /// Sets the pitch angle of the map in degrees, where `0` means
1492
- /// perpendicular to the surface of the map.
1493
- pitch : Option < f64 > ,
1494
- /// Sets the style of the map.
1495
- style : Option < MapboxStyle > ,
1496
1458
/// Sets the zoom level of the map.
1497
1459
zoom : Option < u8 > ,
1460
+ /// Sets the projection of the map
1461
+ #[ field_setter( default = "Projection::new().projection_type(ProjectionType::Orthographic)" ) ]
1462
+ projection : Option < Projection > ,
1463
+ /// If to show the ocean or not
1464
+ #[ field_setter( default = "Some(true)" ) ]
1465
+ showocean : Option < bool > ,
1466
+ /// Sets the color of the ocean
1467
+ #[ field_setter( default = "'rgb(0, 255, 255)'" ) ]
1468
+ oceancolor : Option < Box < dyn Color > > ,
1469
+ /// If to show the land or not
1470
+ showland : Option < bool > ,
1471
+ /// Sets the color of the land
1472
+ landcolor : Option < Box < dyn Color > > ,
1473
+ /// If to show lakes or not
1474
+ showlakes : Option < bool > ,
1475
+ /// Sets the color of the lakes
1476
+ lakecolor : Option < Box < dyn Color > > ,
1477
+ /// If to show countries (borders) or not
1478
+ showcountries : Option < bool > ,
1479
+ /// Configures the longitude axis
1480
+ lonaxis : Option < Axis > ,
1481
+ /// Configures the latitude axis
1482
+ lataxis : Option < Axis > ,
1498
1483
}
1499
1484
1500
1485
impl Geo {
@@ -1600,10 +1585,21 @@ pub enum ProjectionType {
1600
1585
Orthographic ,
1601
1586
}
1602
1587
1588
+ /// Defines the rotation of the projection in degrees.
1589
+ /// The rotation is defined by the longitude and latitude
1590
+ /// of the center of the projection.
1591
+ /// https://plotly.com/javascript/lines-on-maps/
1592
+ #[ derive( Serialize , Debug , Clone ) ]
1593
+ pub struct ProjectionRotation {
1594
+ lon : f64 ,
1595
+ lat : f64 ,
1596
+ }
1597
+
1603
1598
impl From < ProjectionType > for Projection {
1604
1599
fn from ( projection_type : ProjectionType ) -> Self {
1605
1600
Projection {
1606
1601
projection_type : Some ( projection_type) ,
1602
+ rotation : None ,
1607
1603
}
1608
1604
}
1609
1605
}
@@ -1614,6 +1610,7 @@ impl From<ProjectionType> for Projection {
1614
1610
pub struct Projection {
1615
1611
#[ serde( rename = "type" ) ]
1616
1612
projection_type : Option < ProjectionType > ,
1613
+ rotation : Option < ProjectionRotation > ,
1617
1614
}
1618
1615
1619
1616
impl Projection {
0 commit comments