Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

Commit

Permalink
100.11 (#880)
Browse files Browse the repository at this point in the history
* pull from master

* Hud10837/surface placement (#832)

* update java sample to new design

* kotlinize

* clean up

* add readme and metadata details

* add kotlin readme etc

* Update kotlin/surface-placement/src/main/AndroidManifest.xml

Co-Authored-By: TADraeseke <TADraeseke@users.noreply.github.com>

* move apply block to multiple lines

* make enum references all caps

* remove rogue backtick

* add metadata updater instructions for new files (#827)

* Update build.gradle

* Update build.gradle

* add slider

* finish rebase

* tweak layout

* reformat

* add seekbar

* update readmes and format

* update metadata

* add s

* add s

* update scereenshots

* revert metadata updater change

* Update kotlin/surface-placement/src/main/java/com/esri/arcgisruntime/sample/surfaceplacement/MainActivity.kt

Co-authored-by: TADraeseke <TADraeseke@users.noreply.github.com>

* move slider and add value text

* move slider java and format

* make slider background opaque

* edit layout

* update screenshots and java sample

Co-authored-by: TADraeseke <TADraeseke@users.noreply.github.com>

* fix metadata snippet generation (#840)

* Hud10837/realistic lighting and shadows (#836)

* create module

* working sample

* rearrange

* update ui

* add comments and clean

* update ui and metadata

* complete checklist

* change category

* change gradle version

* change data

* fix time zone

* fix time zone format

* version number

* Update kotlin/realistic-lighting-and-shadows/README.metadata.json

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* address pr comments

* block touch events below frame layout

* update data and basemap

* make comments two lines

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* add lifecycle overrides

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* Trev8939/feature linked anno (#838)

* initial commit

* working with read only loudoun data

* working prototype

* rename and add readme and screenshot files

* revert not sample files

* add behaviour to select correct end of polyline and disallow selection of multisegment polylines

* PR fixes

* add fix for dot-qualified call with operator

* add instructions that only straight polylines can be selected

* further PR fixes

* shorten toast length

* update README

* Hud10837/identify fixes (#839)

* feature layer selection

* feature layer show attributes

* list related features

* feature layer selection kotlin

* address pr comments

* reformat function call

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* separate text view name

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* address pr comments

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* Hud10837/readme updates (#842)

* animate images with image overlay

* update readmes

* Hud10837/layer view state (#841)

* create module

* simplify and implement new behavior

* add readme

* change ui

* clean up and add screenshot

* change data source

* add comment

* address pr comments

* update readme and screenshot

* add hide layer option

* add error message and fix ui

* format errors

* update metadata

* implement java sample

* update java readme and metadata

* change string resource names

* address pr comments

* address pr comments

* separate map view name

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* Fix strings

* move airplane mode message

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* minor fixes feature linked anno

* hud10837/readme-changes-aug-4  (#845)

* update readmes

* update identify workflow readmes

* Hud10837/group layer exclusive (#844)

* almost working initial kotlin version

* clean code and add comments

* remove toast

* clean code

* add readme

* add exclusive radio buttons to java sample

* add metadata and copyright and reformat code

* address pr comments kotlin

* address pr comments java

* fix settings gradle

* Update settings.gradle

* Update settings.gradle

* update open scene portal item to netherlands scene

* change open scene portal item to berlin scene

* rename bottom_sheet.xml and other generic xml files (#848)

* Hud10837/mosaic rule (#847)

* initial implementation

* implement spinner

* failing to load

* clean up and add metadata

* Update kotlin/apply-mosaic-rule-rasters/src/main/java/com/esri/arcgisruntime/sample/applymosaicrulerasters/MainActivity.kt

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* Update kotlin/apply-mosaic-rule-rasters/src/main/java/com/esri/arcgisruntime/sample/applymosaicrulerasters/MainActivity.kt

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* remove ags

* change data

* Update kotlin/apply-mosaic-rule-rasters/README.md

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* Update kotlin/apply-mosaic-rule-rasters/README.md

Co-authored-by: TADraeseke <tdraeseke@esri.com>

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* add try/catch to configure subnetwork trace add (#849)

* make smaller barrier in route around barriers and give checkbox unique name in group layers (#851)

* Hud10837/route tracker (#850)

* buggy

* add route tracker location data source to navigate route

* add route tracker location data source

* Update kotlin/navigate-route/src/main/java/com/esri/arcgisruntime/sample/navigateroute/MainActivity.kt

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* Update kotlin/navigate-route/src/main/java/com/esri/arcgisruntime/sample/navigateroute/MainActivity.kt

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* Update kotlin/navigate-route/README.md

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* update java readme

Co-authored-by: TADraeseke <tdraeseke@esri.com>

* update sample to congressional districts (#852)

* Trev8939/update dependency versions (#853)

* set versions to 100.9

* rename mosaic rule

* Update README.md

* Update version.gradle

* Update version.gradle

* http to https

Merging this to test in daily build

* Hud10837/edit with branch versioning (#855)

* initial veprototype almost working

* debugging

* working prototype

* change method of getting createdversionname

* the same but better

* add comments and kdoc

* add lifecycle overrides

* separate edit location into its own button

* clean up

* remove redundant boolean

* clear selection on cancel

* remove redundant defaultversionname member

* remove redundant currentversionname member

* clean up dialog builders

* fix typo

* update metadata

* update category

* update edit with branch versioning

* update edit with branch versioning (#858)

Co-authored-by: trev8939 <tdraeseke@esri.com>

* set version.gradle up U10

* give unique name and password

* update integrated mesh layer screenshots

* fix edit with branch versioning screenshot

* Update README.metadata.json

* Update README.metadata.json

* Samples to new metered basemaps (#862)

* up to and including display map

* add comment and done up to feature layer selection

* all kotlin samples to metered basemaps

* up to and including display map

* part way up to find service area

* up to feature layer geodatabase

* all new basemaps

* fix viewpoint setter and update readmes

* set initial viewpoint to map view setter

* increment to 100.10 release

* increment to 100.10

* target U11 daily builds

* Update version.gradle

* set v.next to toolkit daily

* Update version.gradle

* Trev8939/update samples with zip (#868)

* fix provision info as per updates to sample viewer

* revert version.gradle

* version.gradle to build 3057

* Trev8939/show labels on layers in 3d (#870)

* still need to fix viewbinding and label expression

* wrong labels showing

* add 3d labels sample and readme

* remove old string values

* remove old string values

* update colors

* PR fixes

* README and README json fixes

* fix script and add relevant api to keywords

* Update README.metadata.json

* update label definition to new constructor

* update identify kml features with fix

* version.gradle to last u11 daily

* fixes for trace and isolation samples (#879)

* Update MainActivity.kt

* setup for U11

* update README and gradle files

Co-authored-by: hud10837 <hud10837@esri.com>
Co-authored-by: TADraeseke <TADraeseke@users.noreply.github.com>
Co-authored-by: hud10837 <hmiears@esri.com>
  • Loading branch information
4 people authored Apr 22, 2021
1 parent 1a9492c commit 01a5da9
Show file tree
Hide file tree
Showing 34 changed files with 954 additions and 407 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Overview
ArcGIS Runtime API for Android v100.10.0 samples. The `master` branch of this repository contains sample app modules for the latest available version of the [ArcGIS Runtime API for Android](https://developers.arcgis.com/android/). Samples released under older versions can be found through the [git tags](https://github.com/Esri/arcgis-runtime-samples-android/tags). Please read our [wiki](https://github.com/Esri/arcgis-runtime-samples-android/wiki) for help with working with this repository.
ArcGIS Runtime API for Android v100.11.0 samples. The `master` branch of this repository contains sample app modules for the latest available version of the [ArcGIS Runtime API for Android](https://developers.arcgis.com/android/). Samples released under older versions can be found through the [git tags](https://github.com/Esri/arcgis-runtime-samples-android/tags). Please read our [wiki](https://github.com/Esri/arcgis-runtime-samples-android/wiki) for help with working with this repository.

# Prerequisites
* The samples are building with `compileSdkVersion 29`
* The samples are building with `compileSdkVersion 30`
* [Android Studio](http://developer.android.com/sdk/index.html)
* [An ArcGIS Developers API key](https://developers.arcgis.com/android/get-started/#3-get-an-api-key)

Expand Down
2 changes: 1 addition & 1 deletion java/identify-kml-features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Note: There are several types of KML features. This sample only identifies featu

## About the data

This sample shows a forecast for significant weather within the U.S. Regions of severe thunderstorms, flooding, snowfall, and freezing rain are shown. Tap the features to see details.
This sample shows a forecast for [significant weather within the U.S. Regions](https://www.wpc.ncep.noaa.gov/kml/kmlproducts.php#sigwx) of severe thunderstorms, flooding, snowfall, and freezing rain are shown.

## Additional information

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.esri.arcgisruntime.sample.identifykmlfeatures;

import java.util.concurrent.ExecutionException;

import android.os.Bundle;
import android.text.Html;
import android.util.Log;
Expand All @@ -26,6 +24,7 @@
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
import com.esri.arcgisruntime.concurrent.ListenableFuture;
import com.esri.arcgisruntime.geometry.Envelope;
Expand All @@ -41,6 +40,8 @@
import com.esri.arcgisruntime.ogc.kml.KmlDataset;
import com.esri.arcgisruntime.ogc.kml.KmlPlacemark;

import java.util.concurrent.ExecutionException;

public class MainActivity extends AppCompatActivity {

private static final String TAG = MainActivity.class.getSimpleName();
Expand All @@ -67,7 +68,7 @@ protected void onCreate(Bundle savedInstanceState) {
SpatialReferences.getWebMercator()));

// create a KML dataset of weather forecasts
KmlDataset forecastKmlDataset = new KmlDataset("https://www.wpc.ncep.noaa.gov/kml/noaa_chart/WPC_Day1_SigWx.kml");
KmlDataset forecastKmlDataset = new KmlDataset("https://www.wpc.ncep.noaa.gov/kml/noaa_chart/WPC_Day1_SigWx_latest.kml");

// create a KML layer and add it as an operational layer
KmlLayer forecastKmlLayer = new KmlLayer(forecastKmlDataset);
Expand All @@ -92,6 +93,11 @@ protected void onCreate(Bundle savedInstanceState) {
if (geoElement instanceof KmlPlacemark) {
// show a callout at the placemark with custom content using the placemark's "balloon content"
KmlPlacemark placemark = (KmlPlacemark) geoElement;
// Google Earth only displays the placemarks with description or extended data. To
// match its behavior, add a description placeholder if the data source is empty
if (placemark.getDescription().isEmpty()) {
placemark.setDescription("Weather condition");
}
TextView calloutContent = new TextView(getApplicationContext());
calloutContent.setText(Html.fromHtml(placemark.getBalloonContent()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ import com.esri.arcgisruntime.mapping.Viewpoint
import com.esri.arcgisruntime.mapping.view.DefaultMapViewOnTouchListener
import com.esri.arcgisruntime.mapping.view.Graphic
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay
import com.esri.arcgisruntime.security.AuthenticationChallengeHandler
import com.esri.arcgisruntime.security.AuthenticationChallengeResponse
import com.esri.arcgisruntime.security.AuthenticationManager
import com.esri.arcgisruntime.security.UserCredential
import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol
import com.esri.arcgisruntime.symbology.SimpleRenderer
Expand Down Expand Up @@ -84,10 +87,18 @@ class MainActivity : AppCompatActivity() {
// location services
ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY)

// set user credentials to authenticate with the service
// NOTE: a licensed user is required to perform utility network operations
val userCredential = UserCredential("viewer01", "I68VGU^nMurF")

// load the utility network data from the feature service and create feature layers
val distributionLineFeatureTable = ServiceFeatureTable(getString(R.string.distribution_line_url))
val distributionLineFeatureTable = ServiceFeatureTable(getString(R.string.distribution_line_url)).apply {
credential = userCredential
}
val distributionLineLayer = FeatureLayer(distributionLineFeatureTable)
val deviceFeatureTable = ServiceFeatureTable(getString(R.string.device_url))
val deviceFeatureTable = ServiceFeatureTable(getString(R.string.device_url)).apply {
credential = userCredential
}
val deviceLayer = FeatureLayer(deviceFeatureTable)

// create a map with the utility network distribution line and device layers
Expand All @@ -96,7 +107,7 @@ class MainActivity : AppCompatActivity() {
operationalLayers.addAll(listOf(distributionLineLayer, deviceLayer))
// create and load the utility network
addDoneLoadingListener {
createUtilityNetwork()
createUtilityNetwork(userCredential)
}
}

Expand Down Expand Up @@ -134,12 +145,10 @@ class MainActivity : AppCompatActivity() {
* Create and load a utility network from the string resource url and initialize a starting point
* from it.
*/
private fun createUtilityNetwork() {
private fun createUtilityNetwork(userCredential: UserCredential) {
// create a utility network from the url and load it
utilityNetwork = UtilityNetwork(getString(R.string.utility_network_url), mapView.map).apply {
// set user credentials to authenticate with the service
// NOTE: a licensed user is required to perform utility network operations
credential = UserCredential("viewer01", "I68VGU^nMurF")
credential = userCredential
}
utilityNetwork.loadAsync()
utilityNetwork.addDoneLoadingListener {
Expand Down
1 change: 1 addition & 0 deletions kotlin/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ include ':add-features-feature-service',
':set-min-max-scale',
':show-callout',
':show-labels-on-layer',
':show-labels-on-layer-in-3d',
':surface-placement',
':token-authentication',
':trace-utility-network',
Expand Down
1 change: 1 addition & 0 deletions kotlin/show-labels-on-layer-in-3d/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
40 changes: 40 additions & 0 deletions kotlin/show-labels-on-layer-in-3d/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Show labels on layer in 3D

Display custom labels in a 3D scene.

![Show labels on layer in 3D](show-labels-on-layer-3d.png)

## Use case

Labeling features is useful to visually display information or attributes on a scene. For example, city officials or maintenance crews may want to show installation dates of features of a gas network.

## How to use the sample

Pan and zoom to explore the scene. Notice the labels showing installation dates of features in the 3D gas network.

## How it works

1. Create an `ArcGISScene` from a `PortalItem`.
2. Add the scene to an `SceneView` and load it.
3. After loading is complete, obtain the `FeatureLayer` from one of the `GroupLayer`s in the scene's `operationalLayers`.
4. Create an `TextSymbol` to use for displaying the label text.
5. Create an `LabelDefinition` using an `ArcadeLabelExpression`.
6. Add the definition to the feature layer's `labelDefinitions` array.
7. Set the feature layer's `labelsEnabled` property to `true`.

## Relevant API

* ArcadeLabelExpression
* ArcGISScene
* FeatureLayer
* LabelDefinition
* SceneView
* TextSymbol

## About the data

This sample shows a [New York City infrastructure](https://www.arcgis.com/home/item.html?id=850dfee7d30f4d9da0ebca34a533c169) scene hosted on ArcGIS Online.

## Tags

3D, arcade, attribute, buildings, label, model, scene, symbol, text, URL, visualization
41 changes: 41 additions & 0 deletions kotlin/show-labels-on-layer-in-3d/README.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"category": "Visualization",
"description": "Display custom labels in a 3D scene.",
"formal_name": "ShowLabelsOnLayerIn3D",
"ignore": false,
"images": [
"show-labels-on-layer-in-3d.png"
],
"keywords": [
"3D",
"URL",
"arcade",
"attribute",
"buildings",
"label",
"model",
"scene",
"symbol",
"text",
"visualization",
"ArcGISScene",
"ArcadeLabelExpression",
"FeatureLayer",
"LabelDefinition",
"SceneView",
"TextSymbol"
],
"language": "kotlin",
"relevant_apis": [
"ArcGISScene",
"ArcadeLabelExpression",
"FeatureLayer",
"LabelDefinition",
"SceneView",
"TextSymbol"
],
"snippets": [
"src/main/java/com/esri/arcgisruntime/showlabelsonlayerin3d/MainActivity.kt"
],
"title": "Show labels on layer in 3D"
}
29 changes: 29 additions & 0 deletions kotlin/show-labels-on-layer-in-3d/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
applicationId "com.esri.arcgisruntime.samples.showlabelsonlayerin3d"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
buildConfigField("String", "API_KEY", API_KEY)
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
// arcgis-android & appcompat lib dependencies from rootProject build.gradle
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
implementation "com.google.code.gson:gson:2.8.6"
}
21 changes: 21 additions & 0 deletions kotlin/show-labels-on-layer-in-3d/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions kotlin/show-labels-on-layer-in-3d/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.esri.arcgisruntime.showlabelsonlayerin3d">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* Copyright 2021 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package com.esri.arcgisruntime.showlabelsonlayerin3d

import android.graphics.Color
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment
import com.esri.arcgisruntime.arcgisservices.LabelDefinition
import com.esri.arcgisruntime.arcgisservices.LabelingPlacement
import com.esri.arcgisruntime.layers.FeatureLayer
import com.esri.arcgisruntime.mapping.ArcGISScene
import com.esri.arcgisruntime.mapping.labeling.ArcadeLabelExpression
import com.esri.arcgisruntime.portal.Portal
import com.esri.arcgisruntime.portal.PortalItem
import com.esri.arcgisruntime.symbology.TextSymbol
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY)

val portal = Portal("https://www.arcgis.com")
val portalItem = PortalItem(portal, "850dfee7d30f4d9da0ebca34a533c169")

val scene = ArcGISScene(portalItem)
scene.addDoneLoadingListener {
// get "Gas Main" feature layer from the "Gas" layer
(scene.operationalLayers.first { it.name == "Gas" }
.subLayerContents.first { it.name == "Gas Main" } as? FeatureLayer)?.let { gasMainFeatureLayer ->
gasMainFeatureLayer.apply {
// clear the existing label definition
labelDefinitions.clear()
// add the label definition defined in the makeLabelDefinition function
labelDefinitions.add(makeLabelDefinition())
// enable labels
isLabelsEnabled = true
}
}
}

sceneView.scene = scene
}

private fun makeLabelDefinition(): LabelDefinition {
// make and stylize the text symbol
val textSymbol = TextSymbol().apply {
color = getColor(R.color.colorLabels)
haloColor = Color.WHITE
haloWidth = 2f
size = 16f
}

// create a label expression to show the installation date in day, month, year format
val labelExpression = ArcadeLabelExpression("Text(\$feature.INSTALLATIONDATE, `DD MMM YY`)")

// create and return a label definition
return LabelDefinition(labelExpression, textSymbol).apply {
placement = LabelingPlacement.LINE_ABOVE_ALONG
isUseCodedValues = true
}
}

override fun onPause() {
sceneView.pause()
super.onPause()
}

override fun onResume() {
super.onResume()
sceneView.resume()
}

override fun onDestroy() {
sceneView.dispose()
super.onDestroy()
}
}
Loading

0 comments on commit 01a5da9

Please sign in to comment.