Skip to content

Commit

Permalink
android 플랫폼 맵뷰 liteMode 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadFlask committed Apr 18, 2021
1 parent dffb56d commit 1b60bf6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ public void setStopGesturesEnabled(boolean enabled) {
getMapAsync(e -> naverMap.getUiSettings().setStopGesturesEnabled(enabled));
}

@Override
public void setLiteModeEnabled(boolean enabled) {
getMapAsync(e -> naverMap.setLiteModeEnabled(enabled));
}

@Override
public void moveCameraFitBound(LatLngBounds bounds, int left, int top, int right, int bottom) {
getMapAsync(e -> naverMap.moveCamera(CameraUpdate.fitBounds(bounds, left, top, right, bottom).animate(CameraAnimation.Fly, 500)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ public void setStopGesturesEnabled(boolean enabled) {
mapView.setStopGesturesEnabled(enabled);
}

@Override
public void setLiteModeEnabled(boolean enabled) {
if (mapView != null)
mapView.setLiteModeEnabled(enabled);
}

@Override
public void moveCameraFitBound(LatLngBounds bounds, int left, int top, int right, int bottom) {
if (mapView != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ public void setStopGesturesEnabled(RNNaverMapViewContainer mapView, boolean enab
mapView.setStopGesturesEnabled(enabled);
}

@ReactProp(name = "liteModeEnabled", defaultBoolean = false)
public void setLiteModeEnabled(RNNaverMapViewContainer mapView, boolean enabled) {
mapView.setLiteModeEnabled(enabled);
}

private Rect getRect(@Nullable ReadableMap padding, float density) {
int left = 0;
int top = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public interface RNNaverMapViewProps {

void setStopGesturesEnabled(boolean enabled);

void setLiteModeEnabled(boolean enabled);

void moveCameraFitBound(LatLngBounds bounds, int left, int top, int right, int bottom);

void addFeature(View child, int index);
Expand Down
9 changes: 6 additions & 3 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,26 @@ const MapViewScreen2 = ({navigation}) => {
<Text>scrollGesturesEnabled: default</Text>
<NaverMapView style={{width: '100%', height: 200}}
center={{...P0, zoom: 15}}
useTextureView>
useTextureView
liteModeEnabled>
<Marker coordinate={P0}/>
</NaverMapView>
{Array.from({length: 10}, (_, i) => i).map(i => <Text key={i}></Text>)}
<Text>scrollGesturesEnabled</Text>
<NaverMapView style={{width: '100%', height: 200}}
center={{...P0, zoom: 15}}
scrollGesturesEnabled
useTextureView>
useTextureView
liteModeEnabled>
<Marker coordinate={P0}/>
</NaverMapView>
{Array.from({length: 10}, (_, i) => i).map(i => <Text key={i}></Text>)}
<Text>scrollGesturesEnabled: false</Text>
<NaverMapView style={{width: '100%', height: 200}}
center={{...P0, zoom: 15}}
scrollGesturesEnabled={false}
useTextureView>
useTextureView
liteModeEnabled>
<Marker coordinate={P0}/>
</NaverMapView>
{Array.from({length: 10}, (_, i) => i).map(i => <Text key={i}></Text>)}
Expand Down
3 changes: 2 additions & 1 deletion index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ export interface NaverMapViewProps {
tiltGesturesEnabled?: boolean;
rotateGesturesEnabled?: boolean;
stopGesturesEnabled?: boolean;
liteModeEnabled?: boolean;
useTextureView?: boolean;
}

export default class NaverMapView extends Component<NaverMapViewProps> {
export default class NaverMapView extends Component<NaverMapViewProps, {}> {
ref?: RNNaverMapView;
nodeHandle?: null | number;

Expand Down

0 comments on commit 1b60bf6

Please sign in to comment.