Skip to content

Commit

Permalink
Migrate all channel and view IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhnroyal committed Jun 6, 2024
1 parent 160bb5a commit 5f7dd92
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
public class MapLibreMapsPlugin implements FlutterPlugin, ActivityAware {

private static final String VIEW_TYPE = "plugins.flutter.io/mapbox_gl";
private static final String VIEW_TYPE = "plugins.flutter.io/maplibre_gl";

static FlutterAssets flutterAssets;
private Lifecycle lifecycle;
Expand All @@ -43,13 +43,13 @@ public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
flutterAssets = binding.getFlutterAssets();

MethodChannel methodChannel =
new MethodChannel(binding.getBinaryMessenger(), "plugins.flutter.io/mapbox_gl");
new MethodChannel(binding.getBinaryMessenger(), "plugins.flutter.io/maplibre_gl");
methodChannel.setMethodCallHandler(new GlobalMethodHandler(binding));

binding
.getPlatformViewRegistry()
.registerViewFactory(
"plugins.flutter.io/mapbox_gl",
"plugins.flutter.io/maplibre_gl",
new MapLibreMapFactory(
binding.getBinaryMessenger(),
new LifecycleProvider() {
Expand Down
4 changes: 2 additions & 2 deletions ios/Classes/SwiftMapboxGlFlutterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ public class SwiftMapboxGlFlutterPlugin: NSObject, FlutterPlugin {

public static func register(with registrar: FlutterPluginRegistrar) {
let instance = MapboxMapFactory(withRegistrar: registrar)
registrar.register(instance, withId: "plugins.flutter.io/mapbox_gl")
registrar.register(instance, withId: "plugins.flutter.io/maplibre_gl")

let channel = FlutterMethodChannel(
name: "plugins.flutter.io/mapbox_gl",
name: "plugins.flutter.io/maplibre_gl",
binaryMessenger: registrar.messenger()
)

Expand Down
2 changes: 1 addition & 1 deletion lib/src/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

part of '../maplibre_gl.dart';

const _globalChannel = MethodChannel('plugins.flutter.io/mapbox_gl');
const _globalChannel = MethodChannel('plugins.flutter.io/maplibre_gl');

/// Copy tiles db file passed in to the tiles cache directory (sideloaded) to
/// make tiles available offline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class MapLibreMethodChannel extends MapLibrePlatform {
if (defaultTargetPlatform == TargetPlatform.android) {
if (useHybridComposition) {
return PlatformViewLink(
viewType: 'plugins.flutter.io/mapbox_gl',
viewType: 'plugins.flutter.io/maplibre_gl',
surfaceFactory: (
BuildContext context,
PlatformViewController controller,
Expand All @@ -155,7 +155,7 @@ class MapLibreMethodChannel extends MapLibrePlatform {
onCreatePlatformView: (PlatformViewCreationParams params) {
final controller = PlatformViewsService.initAndroidView(
id: params.id,
viewType: 'plugins.flutter.io/mapbox_gl',
viewType: 'plugins.flutter.io/maplibre_gl',
layoutDirection: TextDirection.ltr,
creationParams: creationParams,
creationParamsCodec: const StandardMessageCodec(),
Expand All @@ -175,7 +175,7 @@ class MapLibreMethodChannel extends MapLibrePlatform {
);
} else {
return AndroidView(
viewType: 'plugins.flutter.io/mapbox_gl',
viewType: 'plugins.flutter.io/maplibre_gl',
onPlatformViewCreated: onPlatformViewCreated,
gestureRecognizers: gestureRecognizers,
creationParams: creationParams,
Expand All @@ -184,7 +184,7 @@ class MapLibreMethodChannel extends MapLibrePlatform {
}
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
return UiKitView(
viewType: 'plugins.flutter.io/mapbox_gl',
viewType: 'plugins.flutter.io/maplibre_gl',
onPlatformViewCreated: onPlatformViewCreated,
gestureRecognizers: gestureRecognizers,
creationParams: creationParams,
Expand Down
18 changes: 0 additions & 18 deletions maplibre_gl_web/ios/maplibre_gl_web.podspec

This file was deleted.

5 changes: 3 additions & 2 deletions maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class MapLibreMapController extends MapLibrePlatform
Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers) {
_creationParams = creationParams;
_registerViewFactory(onPlatformViewCreated, hashCode);
return HtmlElementView(viewType: 'plugins.flutter.io/mapbox_gl_$hashCode');
return HtmlElementView(
viewType: 'plugins.flutter.io/maplibre_gl_$hashCode');
}

@override
Expand All @@ -43,7 +44,7 @@ class MapLibreMapController extends MapLibrePlatform
void _registerViewFactory(Function(int) callback, int identifier) {
// ignore: undefined_prefixed_name
ui.platformViewRegistry.registerViewFactory(
'plugins.flutter.io/mapbox_gl_$identifier', (int viewId) {
'plugins.flutter.io/maplibre_gl_$identifier', (int viewId) {
_mapElement = html.DivElement()
..style.position = 'absolute'
..style.top = '0'
Expand Down

0 comments on commit 5f7dd92

Please sign in to comment.