diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..ef7a790 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,56 @@ +plugins { + id 'com.android.application' + id 'kotlin-android' + + id 'kotlin-android-extensions' + id 'kotlin-kapt' +} + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + defaultConfig { + applicationId "guillermo.lagos.svtl" + minSdkVersion 21 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'androidx.core:core-ktx:1.3.2' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.2.1' + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + + + // map box + implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.5.0' + implementation 'com.jakewharton.timber:timber:4.7.1' + + implementation project(':svtl') + + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/guillermo/lagos/svtl/ExampleInstrumentedTest.kt b/app/src/androidTest/java/guillermo/lagos/svtl/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..153e4a8 --- /dev/null +++ b/app/src/androidTest/java/guillermo/lagos/svtl/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package guillermo.lagos.svtl + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("guillermo.lagos.svtl", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..88196e6 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/mbStyle.json b/app/src/main/assets/mbStyle.json new file mode 100755 index 0000000..269fce0 --- /dev/null +++ b/app/src/main/assets/mbStyle.json @@ -0,0 +1,3788 @@ +{ + "version": 8, + "name": "OSM Liberty", + "metadata": { + "mapbox:type": "template" + }, + "sources": { + "openmaptiles": { + "type": "vector", + "tiles": [ + "http://localhost:8888/your-mb-id/{z}/{x}/{y}.pbf" + ] + } + }, + "sprite": "https://rawgit.com/lukasmartinelli/osm-liberty/gh-pages/sprites/osm-liberty", + "glyphs": "https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "rgb(239,239,239)" + } + }, + { + "id": "park", + "type": "fill", + "source": "openmaptiles", + "source-layer": "park", + "filter": [ + "all" + ], + "paint": { + "fill-color": "#d8e8c8", + "fill-opacity": 0.7, + "fill-outline-color": "rgba(95, 208, 100, 1)" + } + }, + { + "id": "park_outline", + "type": "line", + "source": "openmaptiles", + "source-layer": "park", + "filter": [ + "all" + ], + "paint": { + "line-dasharray": [ + 1, + 1.5 + ], + "line-color": "rgba(228, 241, 215, 1)", + "line-opacity": 1 + }, + "layout": {} + }, + { + "id": "landuse_residential", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "landuse", + "maxzoom": 8, + "filter": [ + "==", + "class", + "residential" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": { + "base": 1, + "stops": [ + [ + 9, + "hsla(0, 3%, 85%, 0.84)" + ], + [ + 12, + "hsla(35, 57%, 88%, 0.49)" + ] + ] + } + } + }, + { + "id": "landcover_wood", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "all", + [ + "==", + "class", + "wood" + ] + ], + "paint": { + "fill-antialias": false, + "fill-color": "hsla(98, 61%, 72%, 0.7)", + "fill-opacity": 0.4 + } + }, + { + "id": "landcover_grass", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "all", + [ + "==", + "class", + "grass" + ] + ], + "paint": { + "fill-antialias": false, + "fill-color": "rgba(176, 213, 154, 1)", + "fill-opacity": 0.3 + } + }, + { + "id": "landuse_cemetery", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "cemetery" + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "hsl(75, 37%, 81%)" + } + }, + { + "id": "landuse_hospital", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "hospital" + ], + "paint": { + "fill-color": "#fde" + } + }, + { + "id": "landuse_school", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "school" + ], + "paint": { + "fill-color": "rgb(236,238,204)" + } + }, + { + "id": "waterway_river", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "waterway", + "filter": [ + "==", + "class", + "river" + ], + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.2, + "stops": [ + [ + 11, + 0.5 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "waterway_other", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "waterway", + "filter": [ + "all", + [ + "!=", + "class", + "river" + ] + ], + "layout": { + "line-cap": "round" + }, + "paint": { + "line-color": "#a0c8f0", + "line-width": { + "base": 1.3, + "stops": [ + [ + 13, + 0.5 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "water", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "water", + "paint": { + "fill-color": "rgb(158,189,255)" + } + }, + { + "id": "aeroway_fill", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 11, + "filter": [ + "==", + "$type", + "Polygon" + ], + "paint": { + "fill-color": "rgba(229, 228, 224, 1)", + "fill-opacity": 0.7 + } + }, + { + "id": "aeroway_runway", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 11, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "==", + "class", + "runway" + ] + ], + "paint": { + "line-color": "#f0ede9", + "line-width": { + "base": 1.2, + "stops": [ + [ + 11, + 3 + ], + [ + 20, + 16 + ] + ] + } + } + }, + { + "id": "aeroway_taxiway", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "aeroway", + "minzoom": 11, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "==", + "class", + "taxiway" + ] + ], + "paint": { + "line-color": "#f0ede9", + "line-width": { + "base": 1.2, + "stops": [ + [ + 11, + 0.5 + ], + [ + 20, + 6 + ] + ] + } + } + }, + { + "id": "tunnel_motorway_link_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "motorway" + ], + [ + "==", + "ramp", + 1 + ], + [ + "==", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-dasharray": [ + 0.5, + 0.25 + ], + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "tunnel_service_track_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-dasharray": [ + 0.5, + 0.25 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1 + ], + [ + 16, + 4 + ], + [ + 20, + 11 + ] + ] + } + } + }, + { + "id": "tunnel_link_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "ramp", + "1" + ], + [ + "==", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "tunnel_street_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "street", + "street_limited" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-opacity": { + "stops": [ + [ + 12, + 0 + ], + [ + 12.5, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 0.5 + ], + [ + 13, + 1 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "tunnel_secondary_tertiary_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 17 + ] + ] + } + } + }, + { + "id": "tunnel_trunk_primary_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.7 + ], + [ + 7, + 1.75 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "tunnel_motorway_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "motorway" + ], + [ + "==", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-dasharray": [ + 0.5, + 0.25 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.7 + ], + [ + 7, + 1.75 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "tunnel_path_pedestrian", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "path", + "pedestrian" + ] + ], + "paint": { + "line-color": "hsl(0, 0%, 100%)", + "line-dasharray": [ + 1, + 0.75 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 14, + 0.5 + ], + [ + 20, + 10 + ] + ] + } + } + }, + { + "id": "tunnel_motorway_link", + "metadata": {}, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "motorway_link" + ], + [ + "==", + "ramp", + 1 + ], + [ + "==", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + } + }, + { + "id": "tunnel_service_track", + "metadata": {}, + "paint": { + "line-color": "#fff", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15.5, + 0 + ], + [ + 16, + 2 + ], + [ + 20, + 7.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "tunnel_link", + "metadata": {}, + "paint": { + "line-color": "#fff4c6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "ramp", + "1" + ], + [ + "==", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "tunnel_minor", + "metadata": {}, + "paint": { + "line-color": "#fff", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 13.5, + 0 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "minor" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "tunnel_secondary_tertiary", + "metadata": {}, + "paint": { + "line-color": "#fff4c6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 10 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "tunnel_trunk_primary", + "metadata": {}, + "paint": { + "line-color": "#fff4c6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0 + ], + [ + 7, + 1 + ], + [ + 20, + 18 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "tunnel_motorway", + "metadata": {}, + "paint": { + "line-color": "#ffdaa6", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0 + ], + [ + 7, + 1 + ], + [ + 20, + 18 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "motorway" + ], + [ + "==", + "brunnel", + "tunnel" + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + } + }, + { + "id": "tunnel_major_rail", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "in", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "tunnel_major_rail_hatching", + "metadata": {}, + "paint": { + "line-color": "#bbb", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 3 + ], + [ + 20, + 8 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ] + }, + { + "id": "road_area_pattern", + "metadata": {}, + "paint": { + "fill-pattern": "pedestrian_polygon" + }, + "type": "fill", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "Polygon" + ] + ], + "layout": { + "visibility": "visible" + } + }, + { + "id": "road_motorway_link_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 12, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ], + [ + "==", + "ramp", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "road_service_track_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1 + ], + [ + 16, + 4 + ], + [ + 20, + 11 + ] + ] + } + } + }, + { + "id": "road_link_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "!in", + "class", + "pedestrian", + "path", + "track", + "service" + ], + [ + "==", + "ramp", + "1" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "road_minor_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "minor" + ], + [ + "!=", + "ramp", + "1" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-opacity": { + "stops": [ + [ + 12, + 0 + ], + [ + 12.5, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 0.5 + ], + [ + 13, + 1 + ], + [ + 14, + 4 + ], + [ + 20, + 20 + ] + ] + } + } + }, + { + "id": "road_secondary_tertiary_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ], + [ + "!=", + "ramp", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 17 + ] + ] + } + } + }, + { + "id": "road_trunk_primary_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary", + "trunk" + ], + [ + "!=", + "ramp", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.7 + ], + [ + 7, + 1.75 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "road_motorway_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 5, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ], + [ + "!=", + "ramp", + "1" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.7 + ], + [ + 7, + 1.75 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "road_path_pedestrian", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 14, + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "path", + "pedestrian" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "hsl(0, 0%, 100%)", + "line-dasharray": [ + 1, + 0.7 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 14, + 1 + ], + [ + 20, + 10 + ] + ] + } + } + }, + { + "id": "road_motorway_link", + "metadata": {}, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 12, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ], + [ + "==", + "ramp", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + } + }, + { + "id": "road_service_track", + "metadata": {}, + "paint": { + "line-color": "#fff", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15.5, + 0 + ], + [ + 16, + 2 + ], + [ + 20, + 7.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + } + }, + { + "id": "road_link", + "metadata": {}, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 13, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "ramp", + 1 + ], + [ + "!in", + "class", + "pedestrian", + "path", + "track", + "service" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + } + }, + { + "id": "road_secondary_tertiary", + "metadata": {}, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 8, + 0.5 + ], + [ + 20, + 13 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + } + }, + { + "id": "road_trunk_primary", + "metadata": {}, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0 + ], + [ + 7, + 1 + ], + [ + 20, + 18 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + } + }, + { + "id": "road_motorway", + "metadata": {}, + "paint": { + "line-color": { + "base": 1, + "stops": [ + [ + 5, + "hsl(26, 87%, 62%)" + ], + [ + 6, + "#fc8" + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0 + ], + [ + 7, + 1 + ], + [ + 20, + 18 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "minzoom": 5, + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "motorway" + ], + [ + "!=", + "ramp", + 1 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round", + "visibility": "visible" + } + }, + { + "id": "road_major_rail", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "road_major_rail_hatching", + "metadata": {}, + "paint": { + "line-color": "#bbb", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 3 + ], + [ + 20, + 8 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "==", + "class", + "rail" + ] + ] + }, + { + "id": "road_minor-copy", + "metadata": {}, + "paint": { + "line-color": "#fff", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 13.5, + 0 + ], + [ + 14, + 2.5 + ], + [ + 20, + 18 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "all", + [ + "!in", + "brunnel", + "bridge", + "tunnel" + ], + [ + "in", + "class", + "minor" + ] + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + } + }, + { + "id": "building", + "type": "fill", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "building", + "minzoom": 13, + "maxzoom": 14, + "paint": { + "fill-color": "hsl(35, 8%, 85%)", + "fill-outline-color": { + "base": 1, + "stops": [ + [ + 13, + "hsla(35, 6%, 79%, 0.32)" + ], + [ + 14, + "hsl(35, 6%, 79%)" + ] + ] + } + }, + "layout": { + "visibility": "visible" + } + }, + { + "id": "building-3d", + "type": "fill-extrusion", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "building", + "minzoom": 14, + "paint": { + "fill-extrusion-color": "hsl(35, 8%, 85%)", + "fill-extrusion-height": { + "property": "render_height", + "type": "identity" + }, + "fill-extrusion-base": { + "property": "render_min_height", + "type": "identity" + }, + "fill-extrusion-opacity": 0.8 + }, + "layout": { + "visibility": "visible" + } + }, + { + "id": "bridge_motorway_link_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "motorway_link" + ], + [ + "==", + "ramp", + 1 + ], + [ + "==", + "brunnel", + "bridge" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "bridge_service_track_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#cfcdca", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15, + 1 + ], + [ + 16, + 4 + ], + [ + 20, + 11 + ] + ] + } + } + }, + { + "id": "bridge_link_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "link" + ], + [ + "==", + "brunnel", + "bridge" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 1 + ], + [ + 13, + 3 + ], + [ + 14, + 4 + ], + [ + 20, + 15 + ] + ] + } + } + }, + { + "id": "bridge_street_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "street", + "street_limited" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "hsl(36, 6%, 74%)", + "line-opacity": { + "stops": [ + [ + 12, + 0 + ], + [ + 12.5, + 1 + ] + ] + }, + "line-width": { + "base": 1.2, + "stops": [ + [ + 12, + 0.5 + ], + [ + 13, + 1 + ], + [ + 14, + 4 + ], + [ + 20, + 25 + ] + ] + } + } + }, + { + "id": "bridge_path_pedestrian_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "path", + "pedestrian" + ] + ], + "layout": { + "line-join": "miter", + "visibility": "visible" + }, + "paint": { + "line-color": "hsl(35, 6%, 80%)", + "line-dasharray": [ + 1, + 0 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 14, + 1.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "bridge_secondary_tertiary_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8, + 1.5 + ], + [ + 20, + 17 + ] + ] + } + } + }, + { + "id": "bridge_trunk_primary_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.7 + ], + [ + 7, + 1.75 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "bridge_motorway_casing", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "motorway" + ], + [ + "==", + "brunnel", + "bridge" + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#e9ac77", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0.4 + ], + [ + 6, + 0.7 + ], + [ + 7, + 1.75 + ], + [ + 20, + 22 + ] + ] + } + } + }, + { + "id": "bridge_path_pedestrian", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "path", + "pedestrian" + ] + ], + "paint": { + "line-color": "hsl(0, 0%, 100%)", + "line-dasharray": [ + 1, + 0.3 + ], + "line-width": { + "base": 1.2, + "stops": [ + [ + 14, + 0.5 + ], + [ + 20, + 10 + ] + ] + } + } + }, + { + "id": "bridge_motorway_link", + "metadata": {}, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "motorway_link" + ], + [ + "==", + "ramp", + 1 + ], + [ + "==", + "brunnel", + "bridge" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "bridge_service_track", + "metadata": {}, + "paint": { + "line-color": "#fff", + "line-width": { + "base": 1.2, + "stops": [ + [ + 15.5, + 0 + ], + [ + 16, + 2 + ], + [ + 20, + 7.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "service", + "track" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "bridge_link", + "metadata": {}, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 12.5, + 0 + ], + [ + 13, + 1.5 + ], + [ + 14, + 2.5 + ], + [ + 20, + 11.5 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "link" + ], + [ + "==", + "brunnel", + "bridge" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "bridge_street", + "metadata": {}, + "paint": { + "line-color": "#fff", + "line-opacity": 1, + "line-width": { + "base": 1.2, + "stops": [ + [ + 13.5, + 0 + ], + [ + 14, + 2.5 + ], + [ + 20, + 18 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "minor" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "bridge_secondary_tertiary", + "metadata": {}, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 6.5, + 0 + ], + [ + 7, + 0.5 + ], + [ + 20, + 10 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "secondary", + "tertiary" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "bridge_trunk_primary", + "metadata": {}, + "paint": { + "line-color": "#fea", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0 + ], + [ + 7, + 1 + ], + [ + 20, + 18 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "brunnel", + "bridge" + ], + [ + "in", + "class", + "primary", + "trunk" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "bridge_motorway", + "metadata": {}, + "paint": { + "line-color": "#fc8", + "line-width": { + "base": 1.2, + "stops": [ + [ + 5, + 0 + ], + [ + 7, + 1 + ], + [ + 20, + 18 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "motorway" + ], + [ + "==", + "brunnel", + "bridge" + ] + ], + "layout": { + "line-join": "round" + } + }, + { + "id": "bridge_major_rail", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "rail" + ], + [ + "==", + "brunnel", + "bridge" + ] + ], + "paint": { + "line-color": "#bbb", + "line-width": { + "base": 1.4, + "stops": [ + [ + 14, + 0.4 + ], + [ + 15, + 0.75 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "bridge_major_rail_hatching", + "metadata": {}, + "paint": { + "line-color": "#bbb", + "line-dasharray": [ + 0.2, + 8 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 14.5, + 0 + ], + [ + 15, + 3 + ], + [ + 20, + 8 + ] + ] + } + }, + "type": "line", + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "class", + "rail" + ], + [ + "==", + "brunnel", + "bridge" + ] + ] + }, + { + "id": "boundary_3", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + "in", + "admin_level", + 3, + 4 + ] + ], + "layout": { + "line-join": "round" + }, + "paint": { + "line-color": "#9e9cab", + "line-dasharray": [ + 5, + 1 + ], + "line-width": { + "base": 1, + "stops": [ + [ + 4, + 0.4 + ], + [ + 5, + 1 + ], + [ + 12, + 1.8 + ] + ] + } + } + }, + { + "id": "boundary_2", + "type": "line", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "boundary", + "filter": [ + "all", + [ + "==", + "admin_level", + 2 + ] + ], + "layout": { + "line-cap": "round", + "line-join": "round" + }, + "paint": { + "line-color": "hsl(248, 1%, 41%)", + "line-opacity": { + "base": 1, + "stops": [ + [ + 0, + 0.4 + ], + [ + 4, + 1 + ] + ] + }, + "line-width": { + "base": 1, + "stops": [ + [ + 3, + 1 + ], + [ + 5, + 1.2 + ], + [ + 12, + 3 + ] + ] + } + } + }, + { + "id": "water_name_line", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "water_name", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ] + ], + "layout": { + "text-field": "{name}", + "text-font": [ + "Roboto Regular" + ], + "text-max-width": 5, + "text-size": 12, + "symbol-placement": "line" + }, + "paint": { + "text-color": "#5d60be", + "text-halo-color": "rgba(255,255,255,0.7)", + "text-halo-width": 1 + }, + "minzoom": 0 + }, + { + "id": "water_name_point", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "water_name", + "filter": [ + "==", + "$type", + "Point" + ], + "layout": { + "text-field": "{name}", + "text-font": [ + "Roboto Regular" + ], + "text-max-width": 5, + "text-size": 12 + }, + "paint": { + "text-color": "#5d60be", + "text-halo-color": "rgba(255,255,255,0.7)", + "text-halo-width": 1 + }, + "minzoom": 0 + }, + { + "id": "poi_z16", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 16, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + ">=", + "rank", + 20 + ] + ], + "layout": { + "icon-image": "{class}_11", + "text-anchor": "top", + "text-field": "{name}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-max-width": 9, + "text-offset": [ + 0, + 0.6 + ], + "text-padding": 2, + "text-size": 12 + }, + "paint": { + "text-color": "#666", + "text-halo-blur": 0.5, + "text-halo-color": "#ffffff", + "text-halo-width": 1 + } + }, + { + "id": "poi_z15", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 15, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + ">=", + "rank", + 7 + ], + [ + "<", + "rank", + 20 + ] + ], + "layout": { + "icon-image": "{class}_11", + "text-anchor": "top", + "text-field": "{name}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-max-width": 9, + "text-offset": [ + 0, + 0.6 + ], + "text-padding": 2, + "text-size": 12 + }, + "paint": { + "text-color": "#666", + "text-halo-blur": 0.5, + "text-halo-color": "#ffffff", + "text-halo-width": 1 + } + }, + { + "id": "poi_z14", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "poi", + "minzoom": 14, + "filter": [ + "all", + [ + "==", + "$type", + "Point" + ], + [ + ">=", + "rank", + 1 + ], + [ + "<", + "rank", + 7 + ] + ], + "layout": { + "icon-image": "{class}_11", + "text-anchor": "top", + "text-field": "{name}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-max-width": 9, + "text-offset": [ + 0, + 0.6 + ], + "text-padding": 2, + "text-size": 12 + }, + "paint": { + "text-color": "#666", + "text-halo-blur": 0.5, + "text-halo-color": "#ffffff", + "text-halo-width": 1 + } + }, + { + "id": "poi_transit", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "poi", + "layout": { + "icon-image": "{maki}_11", + "text-anchor": "left", + "text-field": "{name_en}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-max-width": 9, + "text-offset": [ + 0.9, + 0 + ], + "text-padding": 2, + "text-size": 12, + "visibility": "visible" + }, + "paint": { + "text-color": "#4898ff", + "text-halo-blur": 0.5, + "text-halo-color": "#ffffff", + "text-halo-width": 1 + }, + "filter": [ + "all", + [ + "in", + "class", + "bus", + "rail", + "airport" + ] + ] + }, + { + "id": "road_label", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation_name", + "filter": [ + "all" + ], + "layout": { + "symbol-placement": "line", + "text-anchor": "center", + "text-field": "{name}", + "text-font": [ + "Roboto Regular" + ], + "text-offset": [ + 0, + 0.15 + ], + "text-size": { + "base": 1, + "stops": [ + [ + 13, + 12 + ], + [ + 14, + 13 + ] + ] + } + }, + "paint": { + "text-color": "#765", + "text-halo-blur": 0.5, + "text-halo-width": 1 + } + }, + { + "id": "road_shield", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "transportation_name", + "minzoom": 7, + "filter": [ + "all", + [ + "<=", + "ref_length", + 6 + ] + ], + "layout": { + "icon-image": "default_{ref_length}", + "icon-rotation-alignment": "viewport", + "symbol-placement": { + "base": 1, + "stops": [ + [ + 10, + "point" + ], + [ + 11, + "line" + ] + ] + }, + "symbol-spacing": 500, + "text-field": "{ref}", + "text-font": [ + "Roboto Regular" + ], + "text-offset": [ + 0, + 0.1 + ], + "text-rotation-alignment": "viewport", + "text-size": 10, + "icon-size": 0.8 + }, + "paint": {} + }, + { + "id": "place_other", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "in", + "class", + "hamlet", + "island", + "islet", + "neighbourhood", + "suburb" + ] + ], + "layout": { + "text-field": "{name_en}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-letter-spacing": 0.1, + "text-max-width": 9, + "text-size": { + "base": 1.2, + "stops": [ + [ + 12, + 10 + ], + [ + 15, + 14 + ] + ] + }, + "text-transform": "uppercase" + }, + "paint": { + "text-color": "#633", + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 1.2 + } + }, + { + "id": "place_village", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "==", + "class", + "village" + ] + ], + "layout": { + "text-field": "{name_en}", + "text-font": [ + "Roboto Regular" + ], + "text-max-width": 8, + "text-size": { + "base": 1.2, + "stops": [ + [ + 10, + 12 + ], + [ + 15, + 22 + ] + ] + } + }, + "paint": { + "text-color": "#333", + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 1.2 + } + }, + { + "id": "place_town", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "==", + "class", + "town" + ] + ], + "layout": { + "icon-image": { + "base": 1, + "stops": [ + [ + 0, + "dot_9" + ], + [ + 8, + "" + ] + ] + }, + "text-anchor": "bottom", + "text-field": "{name_en}", + "text-font": [ + "Roboto Regular" + ], + "text-max-width": 8, + "text-offset": [ + 0, + 0 + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 7, + 12 + ], + [ + 11, + 16 + ] + ] + } + }, + "paint": { + "text-color": "#333", + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 1.2 + } + }, + { + "id": "place_city", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "minzoom": 5, + "filter": [ + "all", + [ + "==", + "class", + "city" + ] + ], + "layout": { + "icon-image": { + "base": 1, + "stops": [ + [ + 0, + "dot_9" + ], + [ + 8, + "" + ] + ] + }, + "text-anchor": "bottom", + "text-field": "{name_en}", + "text-font": [ + "Roboto Medium" + ], + "text-max-width": 8, + "text-offset": [ + 0, + 0 + ], + "text-size": { + "base": 1.2, + "stops": [ + [ + 7, + 14 + ], + [ + 11, + 24 + ] + ] + }, + "icon-allow-overlap": true, + "icon-optional": false + }, + "paint": { + "text-color": "#333", + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 1.2 + } + }, + { + "id": "state", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "maxzoom": 6, + "layout": { + "text-field": "{name_en}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-size": { + "stops": [ + [ + 4, + 11 + ], + [ + 6, + 15 + ] + ] + }, + "text-transform": "uppercase" + }, + "paint": { + "text-color": "#633", + "text-halo-color": "rgba(255,255,255,0.7)", + "text-halo-width": 1 + }, + "filter": [ + "all", + [ + "==", + "class", + "state" + ] + ] + }, + { + "id": "country_3", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + ">=", + "rank", + 3 + ], + [ + "==", + "class", + "country" + ] + ], + "layout": { + "text-field": "{name_en}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-max-width": 6.25, + "text-size": { + "stops": [ + [ + 3, + 11 + ], + [ + 7, + 17 + ] + ] + }, + "text-transform": "none" + }, + "paint": { + "text-color": "#334", + "text-halo-blur": 1, + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 1 + } + }, + { + "id": "country_2", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "==", + "rank", + 2 + ], + [ + "==", + "class", + "country" + ] + ], + "layout": { + "text-field": "{name_en}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-max-width": 6.25, + "text-size": { + "stops": [ + [ + 2, + 11 + ], + [ + 5, + 17 + ] + ] + }, + "text-transform": "none" + }, + "paint": { + "text-color": "#334", + "text-halo-blur": 1, + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 1 + } + }, + { + "id": "country_1", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "==", + "rank", + 1 + ], + [ + "==", + "class", + "country" + ] + ], + "layout": { + "text-field": "{name_en}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-max-width": 6.25, + "text-size": { + "stops": [ + [ + 1, + 11 + ], + [ + 4, + 17 + ] + ] + }, + "text-transform": "none" + }, + "paint": { + "text-color": "#334", + "text-halo-blur": 1, + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 1 + } + }, + { + "id": "continent", + "type": "symbol", + "metadata": {}, + "source": "openmaptiles", + "source-layer": "place", + "maxzoom": 1, + "layout": { + "text-field": "{name_en}", + "text-font": [ + "Roboto Condensed Italic" + ], + "text-size": 13, + "text-transform": "uppercase", + "text-justify": "center" + }, + "paint": { + "text-color": "#633", + "text-halo-color": "rgba(255,255,255,0.7)", + "text-halo-width": 1 + }, + "filter": [ + "all", + [ + "==", + "class", + "continent" + ] + ] + } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/santiago.mbtiles b/app/src/main/assets/santiago.mbtiles new file mode 100755 index 0000000..207cf6f Binary files /dev/null and b/app/src/main/assets/santiago.mbtiles differ diff --git a/app/src/main/java/guillermo/lagos/svtl/MainActivity.kt b/app/src/main/java/guillermo/lagos/svtl/MainActivity.kt new file mode 100755 index 0000000..b89bf42 --- /dev/null +++ b/app/src/main/java/guillermo/lagos/svtl/MainActivity.kt @@ -0,0 +1,59 @@ +package guillermo.lagos.svtl + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import com.mapbox.mapboxsdk.Mapbox +import com.mapbox.mapboxsdk.maps.MapboxMap +import com.mapbox.mapboxsdk.maps.OnMapReadyCallback +import com.mapbox.mapboxsdk.maps.Style +import com.mapbox.mapboxsdk.style.layers.RasterLayer +import com.mapbox.mapboxsdk.style.sources.RasterSource +import com.mapbox.mapboxsdk.style.sources.TileSet +import kotlinx.android.synthetic.main.activity_main.* +import timber.log.Timber +import java.io.File + +class MainActivity : AppCompatActivity(), OnMapReadyCallback { + + var m: MapboxMap? = null + + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + if (BuildConfig.DEBUG) { + Timber.plant(Timber.DebugTree()) + } + Mapbox.getInstance(this, getString(R.string.mapbox_access_token)) + setContentView(R.layout.activity_main) + map.getMapAsync(this) + } + + + + override fun onMapReady(mapboxMap: MapboxMap) { + m = mapboxMap + mapboxMap.setStyle(Style.SATELLITE) { style -> // Connect to localhost even when device is not connected to internet + Mapbox.setConnected(true) + addMbtiles(style) + } + } + + + fun addMbtiles(style: Style) { + val mbtilesFile = File( "asset://santiago.mbtiles") + val sourceId = "your-mb-id" + val mbSource: TLSource + try { + mbSource = TLSource(this, mbtilesFile.absolutePath,"santiago.mbtiles", sourceId) + mbSource.server_on() + style.addSource(RasterSource(mbSource.id, TileSet(null, + mbSource.url), 256)) // 256 * 256 for raster tiles + val rasterLayer = RasterLayer("raster_layer_id", mbSource.id) + style.addLayer(rasterLayer) + // if mbSource contains vector tiles + m?.setStyle(Style.Builder().fromUri("asset://mbStyle.json")) + } catch (e: TLError.CantReadFile) { + Timber.e("CouldNotReadFileError") + } + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..a53d587 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..a571e60 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..61da551 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c41dd28 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..db5080a Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..6dba46d Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..da31a87 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..15ac681 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..b216f2d Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..f25a419 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e96783c Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..66f1b1b --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100755 index 0000000..d79cd2a --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + NAVIGATION + \ No newline at end of file diff --git a/app/src/main/res/values/strings_map.xml b/app/src/main/res/values/strings_map.xml new file mode 100755 index 0000000..9eb3956 --- /dev/null +++ b/app/src/main/res/values/strings_map.xml @@ -0,0 +1,4 @@ + + + sk.eyJ1IjoiZ3VpbGxlcm1vbGFnb3MwNSIsImEiOiJja2Z4dzU1cWkxZ3NpMzFxcW16MGMzdGN6In0.Otvl0GFpKgQ8tP22ki1tUA + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..409d2b8 --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/app/src/test/java/guillermo/lagos/svtl/ExampleUnitTest.kt b/app/src/test/java/guillermo/lagos/svtl/ExampleUnitTest.kt new file mode 100644 index 0000000..a8105b7 --- /dev/null +++ b/app/src/test/java/guillermo/lagos/svtl/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package guillermo.lagos.svtl + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 11462b8..9c014e0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ buildscript { ext.kotlin_version = "1.4.10" repositories { + maven { url "https://jitpack.io" } google() jcenter() }