Skip to content

Commit

Permalink
use camel case for enum fields
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed May 17, 2024
1 parent e617b90 commit b3ea35e
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 42 deletions.
8 changes: 4 additions & 4 deletions example/lib/attribution.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class _AttributionBodyState extends State<AttributionBody> {
children: [
buildDefaultPositionButton(),
buildPositionButton(null),
buildPositionButton(AttributionButtonPosition.TopRight),
buildPositionButton(AttributionButtonPosition.TopLeft),
buildPositionButton(AttributionButtonPosition.BottomRight),
buildPositionButton(AttributionButtonPosition.BottomLeft),
buildPositionButton(AttributionButtonPosition.topRight),
buildPositionButton(AttributionButtonPosition.topLeft),
buildPositionButton(AttributionButtonPosition.bottomRight),
buildPositionButton(AttributionButtonPosition.bottomLeft),
],
),
Expanded(
Expand Down
6 changes: 3 additions & 3 deletions example/lib/map_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class MapUiBodyState extends State<MapUiBody> {
bool _myLocationEnabled = true;
bool _telemetryEnabled = true;
bool _countriesVisible = true;
MyLocationTrackingMode _myLocationTrackingMode = MyLocationTrackingMode.None;
MyLocationTrackingMode _myLocationTrackingMode = MyLocationTrackingMode.none;
List<Object>? _featureQueryFilter;
Fill? _selectedFill;

Expand Down Expand Up @@ -361,7 +361,7 @@ class MapUiBodyState extends State<MapUiBody> {
doubleClickZoomEnabled: _doubleClickToZoomEnabled,
myLocationEnabled: _myLocationEnabled,
myLocationTrackingMode: _myLocationTrackingMode,
myLocationRenderMode: MyLocationRenderMode.GPS,
myLocationRenderMode: MyLocationRenderMode.gps,
onMapClick: (point, latLng) async {
debugPrint(
"Map click: ${point.x},${point.y} ${latLng.latitude}/${latLng.longitude}");
Expand Down Expand Up @@ -400,7 +400,7 @@ class MapUiBodyState extends State<MapUiBody> {
},
onCameraTrackingDismissed: () {
setState(() {
_myLocationTrackingMode = MyLocationTrackingMode.None;
_myLocationTrackingMode = MyLocationTrackingMode.none;
});
},
onUserLocationUpdated: (location) {
Expand Down
4 changes: 2 additions & 2 deletions example/lib/sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class FullMapState extends State<FullMap> {
final _stylesAndLoaders = [
const StyleInfo(
name: "Vector",
baseStyle: MaplibreStyles.DEMO,
baseStyle: MaplibreStyles.demo,
addDetails: addVector,
position: CameraPosition(target: LatLng(33.3832, -118.4333), zoom: 6),
),
Expand All @@ -270,7 +270,7 @@ class FullMapState extends State<FullMap> {
),
const StyleInfo(
name: "Geojson cluster",
baseStyle: MaplibreStyles.DEMO,
baseStyle: MaplibreStyles.demo,
addDetails: addGeojsonCluster,
position: CameraPosition(target: LatLng(33.5, -118.1), zoom: 5),
),
Expand Down
10 changes: 5 additions & 5 deletions lib/src/maplibre_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class MaplibreMap extends StatefulWidget {
this.dragEnabled = true,
this.trackCameraPosition = false,
this.myLocationEnabled = false,
this.myLocationTrackingMode = MyLocationTrackingMode.None,
this.myLocationRenderMode = MyLocationRenderMode.NORMAL,
this.myLocationTrackingMode = MyLocationTrackingMode.none,
this.myLocationRenderMode = MyLocationRenderMode.normal,
this.logoViewMargins,
this.compassViewPosition,
this.compassViewMargins,
this.attributionButtonPosition = AttributionButtonPosition.BottomRight,
this.attributionButtonPosition = AttributionButtonPosition.bottomRight,
this.attributionButtonMargins,
this.iosLongClickDuration,
this.onMapClick,
Expand All @@ -57,7 +57,7 @@ class MaplibreMap extends StatefulWidget {
AnnotationType.circle,
],
}) : assert(
myLocationRenderMode != MyLocationRenderMode.NORMAL
myLocationRenderMode != MyLocationRenderMode.normal
? myLocationEnabled
: true,
"$myLocationRenderMode requires [myLocationEnabled] set to true.",
Expand Down Expand Up @@ -177,7 +177,7 @@ class MaplibreMap extends StatefulWidget {

/// Specifies if and how the user's heading/bearing is rendered in the user location indicator.
/// See the documentation of [MyLocationRenderMode] for details.
/// If this is set to a value other than [MyLocationRenderMode.NORMAL], [myLocationEnabled] needs to be true.
/// If this is set to a value other than [MyLocationRenderMode.normal], [myLocationEnabled] needs to be true.
final MyLocationRenderMode myLocationRenderMode;

/// Set the layout margins for the Logo
Expand Down
32 changes: 16 additions & 16 deletions maplibre_gl_platform_interface/lib/src/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,43 @@ part of maplibre_gl_platform_interface;

class MaplibreStyles {
/// A very simple MapLibre demo style
static const String DEMO = "https://demotiles.maplibre.org/style.json";
static const String demo = "https://demotiles.maplibre.org/style.json";
}

/// The camera mode, which determines how the map camera will track the rendered location.
enum MyLocationTrackingMode {
None,
Tracking,
TrackingCompass,
TrackingGPS,
none,
tracking,
trackingCompass,
trackingGps,
}

/// Specifies if and how the user's heading/bearing is rendered in the user location indicator.
enum MyLocationRenderMode {
/// Do not show the user's heading/bearing.
NORMAL,
normal,

/// Show the user's heading/bearing as determined by the device's compass. On iOS, this causes the user's location to be shown on the map.
COMPASS,
compass,

/// Show the user's heading/bearing as determined by the device's GPS sensor. Not supported on iOS.
GPS,
gps,
}

/// Compass View Position
enum CompassViewPosition {
TopLeft,
TopRight,
BottomLeft,
BottomRight,
topLeft,
topRight,
bottomLeft,
bottomRight,
}

/// Attribution Button Position
enum AttributionButtonPosition {
TopLeft,
TopRight,
BottomLeft,
BottomRight,
topLeft,
topRight,
bottomLeft,
bottomRight,
}

/// Bounds for the map camera target.
Expand Down
4 changes: 2 additions & 2 deletions maplibre_gl_web/lib/src/convert.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of maplibre_gl_web;
part of '../maplibre_gl_web.dart';

class Convert {
static void interpretMapLibreMapOptions(
Expand Down Expand Up @@ -71,7 +71,7 @@ class Convert {
.values[options['attributionButtonPosition']];
sink.setAttributionButtonAlignment(position);
} else {
sink.setAttributionButtonAlignment(AttributionButtonPosition.BottomRight);
sink.setAttributionButtonAlignment(AttributionButtonPosition.bottomRight);
}
if (options.containsKey('attributionButtonMargins')) {
sink.setAttributionButtonMargins(options['attributionButtonMargins'][0],
Expand Down
20 changes: 10 additions & 10 deletions maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ class MaplibreMapController extends MapLibreGlPlatform

void _onCameraTrackingChanged(bool isTracking) {
if (isTracking) {
onCameraTrackingChangedPlatform(MyLocationTrackingMode.Tracking);
onCameraTrackingChangedPlatform(MyLocationTrackingMode.tracking);
} else {
onCameraTrackingChangedPlatform(MyLocationTrackingMode.None);
onCameraTrackingChangedPlatform(MyLocationTrackingMode.none);
}
}

Expand Down Expand Up @@ -553,16 +553,16 @@ class MaplibreMapController extends MapLibreGlPlatform

String? positionString;
switch (position) {
case CompassViewPosition.TopRight:
case CompassViewPosition.topRight:
positionString = 'top-right';
break;
case CompassViewPosition.TopLeft:
case CompassViewPosition.topLeft:
positionString = 'top-left';
break;
case CompassViewPosition.BottomRight:
case CompassViewPosition.bottomRight:
positionString = 'bottom-right';
break;
case CompassViewPosition.BottomLeft:
case CompassViewPosition.bottomLeft:
positionString = 'bottom-left';
break;
default:
Expand Down Expand Up @@ -599,16 +599,16 @@ class MaplibreMapController extends MapLibreGlPlatform
) {
String? positionString;
switch (position) {
case AttributionButtonPosition.TopRight:
case AttributionButtonPosition.topRight:
positionString = 'top-right';
break;
case AttributionButtonPosition.TopLeft:
case AttributionButtonPosition.topLeft:
positionString = 'top-left';
break;
case AttributionButtonPosition.BottomRight:
case AttributionButtonPosition.bottomRight:
positionString = 'bottom-right';
break;
case AttributionButtonPosition.BottomLeft:
case AttributionButtonPosition.bottomLeft:
positionString = 'bottom-left';
break;
}
Expand Down

0 comments on commit b3ea35e

Please sign in to comment.