Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import 'package:maplibre_example/styled_map_page.dart';
import 'package:maplibre_example/two_maps_page.dart';
import 'package:maplibre_example/user_interface_page.dart';
import 'package:maplibre_example/user_location_page.dart';
import 'package:maplibre_example/web_controls_page.dart';
import 'package:maplibre_example/widget_layer_page.dart';

void main() {
Expand Down Expand Up @@ -66,7 +65,6 @@ class MyApp extends StatelessWidget {
const LayersFillExtrusionPage(),
LayersRasterPage.location: (context) => const LayersRasterPage(),
LayersLinePage.location: (context) => const LayersLinePage(),
WebControlsPage.location: (context) => const WebControlsPage(),
AnnotationsMixedPage.location: (context) =>
const AnnotationsMixedPage(),
AnnotationsCirclePage.location: (context) =>
Expand Down
7 changes: 0 additions & 7 deletions example/lib/menu_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import 'package:maplibre_example/styled_map_page.dart';
import 'package:maplibre_example/two_maps_page.dart';
import 'package:maplibre_example/user_interface_page.dart';
import 'package:maplibre_example/user_location_page.dart';
import 'package:maplibre_example/web_controls_page.dart';
import 'package:maplibre_example/widget_layer_page.dart';

class MenuPage extends StatelessWidget {
Expand Down Expand Up @@ -63,12 +62,6 @@ class MenuPage extends StatelessWidget {
iconData: Icons.notifications,
location: EventsPage.location,
),
if (kIsWeb)
ItemCard(
label: 'Web Controls',
iconData: Icons.toggle_off,
location: WebControlsPage.location,
),
ItemCard(
label: 'Controller',
iconData: Icons.api,
Expand Down
34 changes: 0 additions & 34 deletions example/lib/web_controls_page.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/maplibre.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ export 'src/ui/map_scalebar.dart';
export 'src/ui/map_zoom_buttons.dart';
export 'src/ui/source_attribution.dart';
export 'src/utils.dart';
export 'src/web_controls.dart';
export 'src/widget_layer.dart';
6 changes: 0 additions & 6 deletions lib/src/map_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class MapOptions {
@Deprecated('Renamed to initPitch') double? pitch,
double initPitch = 0,
this.initBearing = 0,
this.webControls = const [],
this.minZoom = 0,
this.maxZoom = 22,
this.minPitch = 0,
Expand Down Expand Up @@ -57,11 +56,6 @@ class MapOptions {
/// The initial center on the map.
final Position? initCenter;

/// A list of user interface control buttons that should get used.
///
/// Only supported on web.
final List<WebMapControl> webControls;

/// The minimum zoom level. Allowed values are 0-24. Defaults to 0.
final double minZoom;

Expand Down
144 changes: 0 additions & 144 deletions lib/src/platform/web/interop/controls.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/src/platform/web/interop/interop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:maplibre/maplibre.dart';
import 'package:web/web.dart';

part 'camera.dart';
part 'controls.dart';
part 'events.dart';
part 'gesture_handlers.dart';
part 'map.dart';
Expand Down
3 changes: 0 additions & 3 deletions lib/src/platform/web/interop/map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ extension type JsMap._(Camera _) implements Camera {
/// Create a new MapLibre map.
external JsMap(MapOptions options);

/// Add a web-only control button to the map.
external void addControl(IControl control);

/// https://github.com/maplibre/maplibre-gl-js/blob/76410880f81de2582be073bc2d730b3f4b8f254d/src/ui/map.ts#L1383
external void on(String type, JSExportedDartFunction listener);

Expand Down
46 changes: 0 additions & 46 deletions lib/src/platform/web/widget_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,52 +66,6 @@ final class MapLibreMapStateWeb extends MapLibreMapState {
_map.setMaxBounds(options.maxBounds?.toJsLngLatBounds());
_updateGestures(options.gestures);

// add controls
for (final control in options.webControls) {
final jsControl = switch (control) {
final WebScaleControl control => interop.ScaleControl(
interop.ScaleControlOptions(
maxWidth: control.maxWidth,
unit: control.unit.name,
),
),
final WebGeolocateControl control => interop.GeolocateControl(
interop.GeolocateControlOptions(
positionOptions: interop.PositionOptions(
enableHighAccuracy:
control.positionOptions.enableHighAccuracy,
maximumAge:
control.positionOptions.maximumAge.inMilliseconds,
timeout: control.positionOptions.timeout.inMilliseconds,
),
),
),
final WebAttributionControl control => interop.AttributionControl(
interop.AttributionControlOptions(
compact: control.compact,
customAttribution: control.customAttribution,
),
),
final WebFullscreenControl _ => interop.FullscreenControl(
interop.FullscreenControlOptions(),
),
final WebLogoControl control => interop.LogoControl(
interop.LogoControlOptions(compact: control.compact),
),
final WebNavigationControl control => interop.NavigationControl(
interop.NavigationControlOptions(
showCompass: control.showCompass,
showZoom: control.showZoom,
visualizePitch: control.visualizePitch,
),
),
final WebTerrainControl control => interop.TerrainControl(
interop.TerrainControlOptions(source: control.source),
),
};
_map.addControl(jsControl);
}

// add callbacks
_map.on(
interop.MapEventType.load,
Expand Down
Loading
Loading