More namespaces updated to Kotlin (#692)
This commit is contained in:
committed by
GitHub
parent
39df4fc2f6
commit
f561031010
@@ -531,7 +531,7 @@ class DataDrivenStyleActivity : AppCompatActivity() {
|
||||
// Add a fill layer
|
||||
mapboxMap.style!!
|
||||
.addLayer(
|
||||
FillLayer(AMSTERDAM_PARKS_LAYER, source.getId())
|
||||
FillLayer(AMSTERDAM_PARKS_LAYER, source.id)
|
||||
.withProperties(
|
||||
PropertyFactory.fillColor(Expression.color(Color.GREEN)),
|
||||
PropertyFactory.fillOutlineColor(Expression.rgb(0, 0, 255)),
|
||||
|
||||
@@ -33,26 +33,25 @@ class GridSourceActivity : AppCompatActivity(), OnMapReadyCallback {
|
||||
* grid.
|
||||
*/
|
||||
internal class GridProvider : GeometryTileProvider {
|
||||
override fun getFeaturesForBounds(bounds: LatLngBounds, zoom: Int): FeatureCollection {
|
||||
override fun getFeaturesForBounds(bounds: LatLngBounds, zoomLevel: Int): FeatureCollection {
|
||||
val features: MutableList<Feature> = ArrayList()
|
||||
val gridSpacing: Double
|
||||
gridSpacing = if (zoom >= 13) {
|
||||
val gridSpacing = if (zoomLevel >= 13) {
|
||||
0.01
|
||||
} else if (zoom >= 11) {
|
||||
} else if (zoomLevel >= 11) {
|
||||
0.05
|
||||
} else if (zoom == 10) {
|
||||
} else if (zoomLevel == 10) {
|
||||
.1
|
||||
} else if (zoom == 9) {
|
||||
} else if (zoomLevel == 9) {
|
||||
0.25
|
||||
} else if (zoom == 8) {
|
||||
} else if (zoomLevel == 8) {
|
||||
0.5
|
||||
} else if (zoom >= 6) {
|
||||
} else if (zoomLevel >= 6) {
|
||||
1.0
|
||||
} else if (zoom == 5) {
|
||||
} else if (zoomLevel == 5) {
|
||||
2.0
|
||||
} else if (zoom >= 4) {
|
||||
} else if (zoomLevel >= 4) {
|
||||
5.0
|
||||
} else if (zoom == 2) {
|
||||
} else if (zoomLevel == 2) {
|
||||
10.0
|
||||
} else {
|
||||
20.0
|
||||
|
||||
@@ -93,11 +93,8 @@ class RealTimeGeoJsonActivity : AppCompatActivity(), OnMapReadyCallback {
|
||||
private val handler: Handler
|
||||
) : Runnable {
|
||||
override fun run() {
|
||||
(
|
||||
mapboxMap.style!!
|
||||
.getSource(ID_GEOJSON_SOURCE) as GeoJsonSource?
|
||||
)!!.url =
|
||||
URL_GEOJSON_SOURCE
|
||||
val geoJsonSource = mapboxMap.style!!.getSource(ID_GEOJSON_SOURCE) as GeoJsonSource
|
||||
geoJsonSource.url = URL_GEOJSON_SOURCE
|
||||
handler.postDelayed(this, 2000)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user