-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from mym0404/camera-idle-callback
feat: `onCameraIdle` Prop
- Loading branch information
Showing
8 changed files
with
155 additions
and
4 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
android/src/main/java/com/mjstudio/reactnativenavermap/event/NaverMapCameraIdleEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.mjstudio.reactnativenavermap.event | ||
|
||
import com.facebook.react.bridge.Arguments | ||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
|
||
class NaverMapCameraIdleEvent( | ||
surfaceId: Int, | ||
viewId: Int, | ||
private val latitude: Double, | ||
private val longitude: Double, | ||
private val zoom: Double, | ||
private val tilt: Double, | ||
private val bearing: Double, | ||
private val regionLatitude: Double, | ||
private val regionLongitude: Double, | ||
private val regionLatitudeDelta: Double, | ||
private val regionLongitudeDelta: Double, | ||
) : Event<NaverMapCameraIdleEvent>(surfaceId, viewId) { | ||
override fun getEventName(): String = EVENT_NAME | ||
|
||
override fun canCoalesce(): Boolean = false | ||
|
||
override fun getCoalescingKey(): Short = 0 | ||
|
||
override fun getEventData(): WritableMap = | ||
Arguments.createMap().apply { | ||
putDouble("latitude", latitude) | ||
putDouble("longitude", longitude) | ||
putDouble("zoom", zoom) | ||
putDouble("tilt", tilt) | ||
putDouble("bearing", bearing) | ||
putDouble("regionLatitude", regionLatitude) | ||
putDouble("regionLongitude", regionLongitude) | ||
putDouble("regionLatitudeDelta", regionLatitudeDelta) | ||
putDouble("regionLongitudeDelta", regionLongitudeDelta) | ||
} | ||
|
||
companion object { | ||
const val EVENT_NAME = "topCameraIdle" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters