Skip to content

Commit

Permalink
Revert whitespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
j-piasecki committed Sep 4, 2023
1 parent fb96e20 commit cf70036
Showing 1 changed file with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV

mPointAnnotationManager = mapView.annotations.createPointAnnotationManager(AnnotationConfig(layerId = "rctmgl-mapview-annotations"))
mPointAnnotationManager?.addClickListener(OnPointAnnotationClickListener { pointAnnotation ->
onMarkerClick(pointAnnotation)
false
}
onMarkerClick(pointAnnotation)
false
}
)
mPointAnnotationManager?.addDragListener(object : OnPointAnnotationDragListener {
override fun onAnnotationDragStarted(_annotation: Annotation<*>) {
Expand All @@ -236,7 +236,7 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
reactAnnotation?.let { it.onDragStart() }
}

override fun onAnnotationDrag(_annotation: Annotation<*>) {
override fun onAnnotationDrag(_annotation: Annotation<*>) {
var reactAnnotation: RCTMGLPointAnnotation? = null
for (key in mPointAnnotations.keys) {
val annotation = mPointAnnotations[key]
Expand Down Expand Up @@ -278,13 +278,13 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
}

private fun setupEvents() {
mMap?.addOnRenderFrameFinishedListener(
object: OnRenderFrameFinishedListener {
override fun onRenderFrameFinished(eventData: RenderFrameFinishedEventData) {
handleMapChangedEvent(EventTypes.DID_FINISH_RENDERING_FRAME_FULLY)
}
}
)
mMap?.addOnRenderFrameFinishedListener(
object: OnRenderFrameFinishedListener {
override fun onRenderFrameFinished(eventData: RenderFrameFinishedEventData) {
handleMapChangedEvent(EventTypes.DID_FINISH_RENDERING_FRAME_FULLY)
}
}
)
}

private fun onMapReady(map: MapboxMap) {
Expand Down Expand Up @@ -371,11 +371,11 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
Logger.e(LOG_TAG, String.format("Map load failed: %s", event.data.toString()))
val errorMessage = event.getMapLoadingErrorEventData().message
val event = MapChangeEvent(this, EventTypes.MAP_LOADING_ERROR, writableMapOf(
"error" to errorMessage
"error" to errorMessage
))
mManager.handleEvent(event)

}, Arrays.asList(MapEvents.MAP_LOADING_ERROR))
}, Arrays.asList(MapEvents.MAP_LOADING_ERROR))
}

fun<T> mapGestureBegin(type:MapGestureType, gesture: T) {
Expand Down Expand Up @@ -490,7 +490,7 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV

fun sendRegionChangeEvent(isAnimated: Boolean) {
val didChangeEvent = MapChangeEvent(this, EventTypes.REGION_DID_CHANGE,
makeRegionPayload(isAnimated))
makeRegionPayload(isAnimated))
mManager.handleEvent(didChangeEvent)
mCameraChangeTracker.setReason(CameraChangeReason.NONE)
}
Expand Down Expand Up @@ -610,11 +610,11 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
styleLoaded(style)
}
},
object : OnMapLoadErrorListener {
override fun onMapLoadError(mapLoadingErrorEventData: MapLoadingErrorEventData) {
Logger.w("MapLoadError", mapLoadingErrorEventData.message)
object : OnMapLoadErrorListener {
override fun onMapLoadError(mapLoadingErrorEventData: MapLoadingErrorEventData) {
Logger.w("MapLoadError", mapLoadingErrorEventData.message)
}
}
}
)
}
}
Expand All @@ -625,10 +625,10 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
}

fun handleTapInSources(
sources: LinkedList<RCTSource<*>>, screenPoint: ScreenCoordinate,
hits: HashMap<String?, List<Feature?>?>,
hitTouchableSources: ArrayList<RCTSource<*>?>,
handleTap: HandleTap
sources: LinkedList<RCTSource<*>>, screenPoint: ScreenCoordinate,
hits: HashMap<String?, List<Feature?>?>,
hitTouchableSources: ArrayList<RCTSource<*>?>,
handleTap: HandleTap
) {
if (sources.isEmpty()) {
handleTap.run(hitTouchableSources, hits)
Expand All @@ -640,17 +640,17 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
val halfWidth = (hitbox["width"]!!.toFloat() / 2.0f).toDouble()
val halfHeight = (hitbox["height"]!!.toFloat() / 2.0f).toDouble()
val screenBox = ScreenBox(
ScreenCoordinate(screenPoint.x - halfWidth,
screenPoint.y - halfHeight
),
ScreenCoordinate(screenPoint.x + halfWidth,
screenPoint.y + halfHeight)
ScreenCoordinate(screenPoint.x - halfWidth,
screenPoint.y - halfHeight
),
ScreenCoordinate(screenPoint.x + halfWidth,
screenPoint.y + halfHeight)
)
mapView.getMapboxMap().queryRenderedFeatures(RenderedQueryGeometry(screenBox),
RenderedQueryOptions(
source.layerIDs,
null
)
RenderedQueryOptions(
source.layerIDs,
null
)
) { features ->
if (features.isValue) {
if (features.value!!.size > 0) {
Expand Down Expand Up @@ -687,9 +687,9 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
val source = getTouchableSourceWithHighestZIndex(hitTouchableSources as List<RCTSource<*>>?)
if (source != null && source.hasPressListener() && source.iD != null && source.iD in hits) {
source.onPress(RCTSource.OnPressEvent(
hits[source.iD] as List<Feature>,
GeoJSONUtils.toLatLng(point),
PointF(screenPoint.x.toFloat(), screenPoint.y.toFloat())
hits[source.iD] as List<Feature>,
GeoJSONUtils.toLatLng(point),
PointF(screenPoint.x.toFloat(), screenPoint.y.toFloat())
))
return
}
Expand Down Expand Up @@ -852,7 +852,7 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
properties.putDouble("heading", position.bearing)
properties.putDouble("pitch", position.pitch)
properties.putBoolean("animated",
if (null == isAnimated) mCameraChangeTracker.isAnimated else isAnimated)
if (null == isAnimated) mCameraChangeTracker.isAnimated else isAnimated)
properties.putBoolean("isUserInteraction", mCameraChangeTracker.isUserInteraction)
try {
val bounds = mMap.coordinateBoundsForCamera(position.toCameraOptions())
Expand All @@ -870,7 +870,7 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
*/
private fun setUpImage(loadedStyle: Style) {
loadedStyle.addImage("MARKER_IMAGE_ID", BitmapFactory.decodeResource(
this.resources, R.drawable.red_marker)
this.resources, R.drawable.red_marker)
)
}

Expand Down Expand Up @@ -971,8 +971,8 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
ScreenCoordinate(rect.left.toDouble(), rect.top.toDouble()),
)
mMap.queryRenderedFeatures(
RenderedQueryGeometry(screenBox),
RenderedQueryOptions(layerIDs, filter)
RenderedQueryGeometry(screenBox),
RenderedQueryOptions(layerIDs, filter)
) { features ->
if (features.isValue) {
val featuresList = ArrayList<Feature?>()
Expand Down

0 comments on commit cf70036

Please sign in to comment.