Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sameri11 committed Aug 7, 2023
1 parent 1e3309f commit 10d853e
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 13 deletions.
150 changes: 145 additions & 5 deletions app/src/main/assets/polyline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,159 @@
"type": "Feature",
"properties": {
"db_sublayer": "s_dynamic_polyline",
"width_zpt": 10,
"width_zpt": 5,
"color": "#ccff0000"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
55.294727300000261,
25.356358000000171
54.94122605802923,
24.89817056124508
],
[
55.189856000000134,
25.144632000000115
54.94457099505519,
24.901926947036145
],
[
54.95030517281285,
24.90611662708565
],
[
54.95635791600199,
24.909872771024098
],
[
54.973082601129164,
24.91594014659556
],
[
55.05609960184586,
24.94499133438191
],
[
55.06939084240892,
24.949794681097515
],
[
55.07703641275245,
24.955138034693704
],
[
55.087230506544756,
24.97073352420243
],
[
55.09282278381349,
24.984333441079784
],
[
55.09951265786407,
25.023886528092376
],
[
55.10301875862183,
25.030526486637143
],
[
55.1337603227131,
25.065303465604913
],
[
55.15003288897654,
25.08262548437486
],
[
55.177270233326084,
25.105416748320863
],
[
55.205188284035046,
25.125206089699034
],
[
55.214533041106336,
25.132817184104454
],
[
55.22950561636341,
25.157761708423507
],
[
55.263775006059745,
25.195887825763478
],
[
55.2836925236943,
25.22385420854384
],
[
55.28783387429749,
25.22875334197495
],
[
55.300098643391436,
25.23192326431763
],
[
55.30712850056713,
25.232956584220176
],
[
55.31875613879819,
25.22791352996188
],
[
55.325605295564486,
25.225752156968042
],
[
55.330065211599134,
25.226328526855255
],
[
55.33500297577959,
25.22993077676408
],
[
55.34089643625293,
25.236990877020787
],
[
55.3396230237901,
25.242464109167884
],
[
55.33643736947988,
25.249523481443134
],
[
55.33675593490992,
25.254997814286114
],
[
55.33787091391852,
25.258599214496755
],
[
55.3369152176256,
25.263640995363318
],
[
55.35874501865732,
25.28381581194202
],
[
55.36149060391827,
25.297973339152037
],
[
55.36547267180572,
25.301717466738864
],
[
55.37439250387362,
25.306037470233846
]
]
}
Expand Down
10 changes: 4 additions & 6 deletions app/src/main/java/ru/dgis/sdk/demo/GeoJsonActivity.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ru.dgis.sdk.demo

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -56,8 +55,8 @@ class GeoJsonActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
binding.addSettingsLayout().apply {
settingsDrawerInnerLayout.addView(settingsBinding.root)
binding.addSettingsLayout {
addView(settingsBinding.root)
}

binding.mapView.getMapAsync {
Expand Down Expand Up @@ -115,7 +114,6 @@ class GeoJsonActivity : AppCompatActivity() {
val geoJsonString = assets.open(filename).bufferedReader().use { it.readText() }
objects = parseGeoJson(geoJsonString)
}
Log.w("FILES", "Reading file $filename")
return objects
}
}
Expand All @@ -124,11 +122,11 @@ class GeoJsonActivity : AppCompatActivity() {
// We are introducing custom function to overcome this.
// For details see: https://kt.academy/article/cc-recipes
@Suppress("UNCHECKED_CAST")
fun <T> suspendLazy(
fun <T : Any> suspendLazy(
initializer: suspend () -> T
): suspend () -> T {
var initializerInner: (suspend () -> T)? = initializer
var holder: Any? = Any()
var holder = Any()

return {
if (initializerInner == null) { holder as T }
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_geo_json.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
android:layout_height="match_parent"
app:dgis_cameraTargetLat="25.204575"
app:dgis_cameraTargetLng="55.25939"
app:dgis_cameraZoom="10" />
app:dgis_cameraZoom="9" />

</FrameLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<string name="gestures">GESTURES</string>
<string name="apply_rule">Apply Rule</string>
<string name="clear_rules">Clear Rules</string>
<string name="multipolygon">MultiPolygon</string>
<string name="multipolygon">Multipolygon</string>
<string name="polygon">Polygon</string>
<string name="polyline">Polyline</string>
<string-array name="route_search_types">
Expand Down

0 comments on commit 10d853e

Please sign in to comment.