Skip to content

Commit

Permalink
UPDATE LOCATION POINT
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesús Calderón committed Apr 4, 2019
1 parent f886b44 commit 94278fd
Show file tree
Hide file tree
Showing 12 changed files with 187 additions and 403 deletions.
Binary file modified .gradle/4.10.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/4.10.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/4.10.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/4.10.1/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified .gradle/4.10.1/javaCompile/jarAnalysis.bin
Binary file not shown.
Binary file modified .gradle/4.10.1/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/4.10.1/javaCompile/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/4.10.1/taskHistory/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/4.10.1/taskHistory/taskHistory.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
570 changes: 168 additions & 402 deletions .idea/workspace.xml

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion app/src/main/java/com/jeluchu/mapboxu/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.jeluchu.mapboxu

import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.app.Activity
import android.app.AlertDialog
Expand Down Expand Up @@ -45,7 +46,7 @@ import com.mapbox.mapboxsdk.plugins.places.autocomplete.model.PlaceOptions
import com.mapbox.mapboxsdk.style.layers.*
import com.mapbox.mapboxsdk.style.layers.Property.NONE
import com.mapbox.mapboxsdk.style.layers.Property.VISIBLE
import com.mapbox.mapboxsdk.style.layers.PropertyFactory.visibility
import com.mapbox.mapboxsdk.style.layers.PropertyFactory.*
import com.mapbox.mapboxsdk.style.sources.GeoJsonSource
import com.mapbox.services.android.navigation.ui.v5.NavigationLauncher
import com.mapbox.services.android.navigation.ui.v5.NavigationLauncherOptions
Expand Down Expand Up @@ -90,6 +91,9 @@ class MainActivity : AppCompatActivity(), OnMapReadyCallback, MapboxMap.OnMapCli

// FILTER
private val listItems = arrayOf("Cámaras", "BiciMad", "Parking")
private val MOPED_FILTER_ICON_ANIMATION_SPEED: Long = 300
private var filterSelected = false


override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.AppTheme)
Expand Down Expand Up @@ -225,6 +229,19 @@ class MainActivity : AppCompatActivity(), OnMapReadyCallback, MapboxMap.OnMapCli

}

private fun increaseIconSize(symbolLayer: SymbolLayer) {
val symbolLayerIconAnimator = ValueAnimator()
symbolLayerIconAnimator.setObjectValues(1f, 1.4f)
symbolLayerIconAnimator.duration = MOPED_FILTER_ICON_ANIMATION_SPEED
symbolLayerIconAnimator.addUpdateListener { animator ->
symbolLayer.setProperties(
iconSize(animator.animatedValue as Float)
)
}
symbolLayerIconAnimator.start()
filterSelected = true
}

// CAMERA LAYER
private fun cameraGeoJsonSource(loadedMapStyle: Style) {
// Load data from GeoJSON file in the assets folder
Expand All @@ -245,6 +262,7 @@ class MainActivity : AppCompatActivity(), OnMapReadyCallback, MapboxMap.OnMapCli
PropertyFactory.iconImage("camera_id")
)
loadedMapStyle.addLayer(symbolLayer)
increaseIconSize(symbolLayer)

}

Expand Down

0 comments on commit 94278fd

Please sign in to comment.