Skip to content

Commit

Permalink
feat: update library sdk to 4.8.0 (#3)
Browse files Browse the repository at this point in the history
* feat: update library sdk to 4.8.0

* build: version 4.8.0

* fix: setLocale
  • Loading branch information
Kt00s authored Sep 27, 2024
1 parent 3a097c7 commit 2d52d3d
Show file tree
Hide file tree
Showing 17 changed files with 6,041 additions and 4,026 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ type MasstransitVehicles = 'bus' | 'trolleybus' | 'tramway' | 'minibus' | 'subur

type Vehicles = MasstransitVehicles | 'walk' | 'car';

type MapType = 'none' | 'raster' | 'vector';


interface DrivingInfo {
time: string;
timeWithTraffic: string;
Expand Down Expand Up @@ -232,7 +229,6 @@ type MappableLogoPadding = {
| maxFps | number | 60 | Maximum card refresh rate |
| logoPosition | MappableLogoPosition | {} | The position of the Mappable logo on the map |
| logoPadding | MappableLogoPadding | {} | Indentation of the Mappable logo on the map |
| mapType | string | 'vector' | Map Type |
| mapStyle | string | {} | Map styles according to the documentation |
#### Available methods for the **MapView** component:
Expand Down
2 changes: 1 addition & 1 deletion RNMappable.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
# s.requires_arc = true

s.dependency "React"
s.dependency "MappableMobile", "4.7.2-full"
s.dependency "MappableMobile", "4.8.0-full"
end
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {

defaultConfig {
compileSdkVersion 34
minSdkVersion 23
minSdkVersion 26
targetSdkVersion 34
versionCode 1
versionName "1.1"
Expand All @@ -33,7 +33,7 @@ repositories {
dependencies {
implementation 'com.google.android.gms:play-services-location:+'
implementation 'com.facebook.react:react-native:+'
implementation 'world.mappable.android:maps.mobile:4.7.2-full'
implementation 'world.mappable.android:maps.mobile:4.8.0-full'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'com.google.android.datatransport:transport-api:3.2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class RNMappableModule internal constructor(context: ReactApplicationContext?) :
@ReactMethod
fun setLocale(locale: String?, successCb: Callback, errorCb: Callback?) {
UiThreadUtil.runOnUiThread(Thread {
I18nManagerFactory.setLocale(locale)
MapKitFactory.setLocale(locale)
successCb.invoke()
})
}
Expand Down
17 changes: 10 additions & 7 deletions android/src/main/java/ru/vvdev/mappable/view/MappableView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap
import com.facebook.react.bridge.WritableNativeArray
import com.facebook.react.uimanager.events.RCTEventEmitter
import ru.vvdev.mappable.models.ReactMapObject
import ru.vvdev.mappable.utils.Callback
import ru.vvdev.mappable.utils.ImageLoader.DownloadImageBitmap
import ru.vvdev.mappable.utils.RouteManager
import world.mappable.mapkit.Animation
import world.mappable.mapkit.MapKitFactory
import world.mappable.mapkit.RequestPoint
Expand Down Expand Up @@ -52,8 +56,11 @@ import world.mappable.mapkit.mapview.MapView
import world.mappable.mapkit.traffic.TrafficLayer
import world.mappable.mapkit.traffic.TrafficLevel
import world.mappable.mapkit.traffic.TrafficListener
import world.mappable.mapkit.transport.TransportFactory
import world.mappable.mapkit.transport.masstransit.FilterVehicleTypes
import world.mappable.mapkit.transport.masstransit.FitnessOptions
import world.mappable.mapkit.transport.masstransit.Route
import world.mappable.mapkit.transport.masstransit.RouteOptions
import world.mappable.mapkit.transport.masstransit.Section
import world.mappable.mapkit.transport.masstransit.Session
import world.mappable.mapkit.transport.masstransit.TimeOptions
Expand All @@ -65,11 +72,6 @@ import world.mappable.mapkit.user_location.UserLocationObjectListener
import world.mappable.mapkit.user_location.UserLocationView
import world.mappable.runtime.Error
import world.mappable.runtime.image.ImageProvider
import ru.vvdev.mappable.models.ReactMapObject
import ru.vvdev.mappable.utils.Callback
import ru.vvdev.mappable.utils.ImageLoader.DownloadImageBitmap
import ru.vvdev.mappable.utils.RouteManager
import world.mappable.mapkit.transport.TransportFactory
import javax.annotation.Nonnull


Expand All @@ -80,6 +82,7 @@ open class MappableView(context: Context?) : MapView(context), UserLocationObjec
private var userLocationIconScale = 1f
private var userLocationBitmap: Bitmap? = null
private val routeMng = RouteManager()
private var routeOptions: RouteOptions = RouteOptions(FitnessOptions(false))
private val masstransitRouter = TransportFactory.getInstance().createMasstransitRouter()
private val drivingRouter: DrivingRouter
private val pedestrianRouter = TransportFactory.getInstance().createPedestrianRouter()
Expand Down Expand Up @@ -336,11 +339,11 @@ open class MappableView(context: Context?) : MapView(context), UserLocationObjec
}
}
if (vehicles.size == 0) {
pedestrianRouter.requestRoutes(_points, TimeOptions(), true, listener)
pedestrianRouter.requestRoutes(_points, TimeOptions(), routeOptions, listener)
return
}
val transitOptions = TransitOptions(FilterVehicleTypes.NONE.value, TimeOptions())
masstransitRouter.requestRoutes(_points, transitOptions, true, listener)
masstransitRouter.requestRoutes(_points, transitOptions, routeOptions, listener)
}

fun fitAllMarkers() {
Expand Down
3 changes: 1 addition & 2 deletions build/components/ClusteredMappable.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { ViewProps, ImageSourcePropType, NativeSyntheticEvent, ListRenderItemInfo } from 'react-native';
import { MapType, Animation, Point, DrivingInfo, MasstransitInfo, RoutesFoundEvent, Vehicles, CameraPosition, VisibleRegion, ScreenPoint, MapLoaded, InitialRegion, MappableLogoPosition, MappableLogoPadding } from '../interfaces';
import { Animation, Point, DrivingInfo, MasstransitInfo, RoutesFoundEvent, Vehicles, CameraPosition, VisibleRegion, ScreenPoint, MapLoaded, InitialRegion, MappableLogoPosition, MappableLogoPadding } from '../interfaces';
export interface ClusteredMappableMapProps<T = any> extends ViewProps {
userLocationIcon?: ImageSourcePropType;
userLocationIconScale?: number;
Expand All @@ -16,7 +16,6 @@ export interface ClusteredMappableMapProps<T = any> extends ViewProps {
showUserPosition?: boolean;
nightMode?: boolean;
mapStyle?: string;
mapType?: MapType;
onCameraPositionChange?: (event: NativeSyntheticEvent<CameraPosition>) => void;
onCameraPositionChangeEnd?: (event: NativeSyntheticEvent<CameraPosition>) => void;
onMapPress?: (event: NativeSyntheticEvent<Point>) => void;
Expand Down
2 changes: 1 addition & 1 deletion build/components/ClusteredMappable.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2d52d3d

Please sign in to comment.