Skip to content

Commit 9c750c6

Browse files
committed
fix: getMapBoundaries
1 parent 31cbeef commit 9c750c6

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

android/src/main/java/com/osmdroid/OsmMapModule.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.osmdroid;
22

33
import android.app.Activity;
4+
import android.util.Log;
45

56
import com.facebook.react.bridge.Promise;
67
import com.facebook.react.bridge.ReactApplicationContext;
@@ -17,6 +18,7 @@
1718
import java.io.Closeable;
1819
import java.io.IOException;
1920

21+
import java.util.Arrays;
2022
import java.util.Map;
2123
import java.util.HashMap;
2224

@@ -245,11 +247,10 @@ public void getMapBoundaries(final int tag, final Promise promise) {
245247
final ReactApplicationContext context = getReactApplicationContext();
246248

247249
UIManagerModule uiManager = context.getNativeModule(UIManagerModule.class);
248-
uiManager.addUIBlock(new UIBlock()
249-
{
250+
assert uiManager != null;
251+
uiManager.addUIBlock(new UIBlock() {
250252
@Override
251-
public void execute(NativeViewHierarchyManager nvhm)
252-
{
253+
public void execute(NativeViewHierarchyManager nvhm) {
253254
OsmMapView view = (OsmMapView) nvhm.resolveView(tag);
254255
if (view == null) {
255256
promise.reject("AirMapView not found");
@@ -269,7 +270,6 @@ public void execute(NativeViewHierarchyManager nvhm)
269270

270271
coordinates.putMap("northEast", northEastHash);
271272
coordinates.putMap("southWest", southWestHash);
272-
273273
promise.resolve(coordinates);
274274
}
275275
});

android/src/main/java/com/osmdroid/OsmdroidPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class OsmdroidPackage implements ReactPackage {
1313
@Override
1414
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
15-
return Collections.emptyList();
15+
return Arrays.<NativeModule>asList(new OsmMapModule(reactContext));
1616
}
1717

1818
@Override

src/MapView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,6 @@ class MapView extends React.Component<MapViewProps> {
818818
return await NativeModules.OsmMapModule.getMapBoundaries(
819819
this._getHandle()
820820
);
821-
} else if (Platform.OS === 'ios') {
822-
return await this._runCommand('getMapBoundaries', []);
823821
}
824822
return Promise.reject('getMapBoundaries not supported on this platform');
825823
}

0 commit comments

Comments
 (0)