We try to load this layer
https://services-eu1.arcgis.com/mXUvYpmRuCvDyiRV/arcgis/rest/services/NRL_PointHigh/FeatureServer/0
It worked with SDK 100.X, but not on 200.X
Issue applies to Swift version to.
Old version 100.X do work
package com.example.droidarcgisplayground
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment
import com.esri.arcgisruntime.data.ServiceFeatureTable
import com.esri.arcgisruntime.layers.FeatureLayer
import com.esri.arcgisruntime.mapping.ArcGISMap
import com.esri.arcgisruntime.mapping.BasemapStyle
import com.esri.arcgisruntime.mapping.view.MapView
class MainActivity : AppCompatActivity() {
private var mapView: MapView? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ArcGISRuntimeEnvironment.setLicense("")
ArcGISRuntimeEnvironment.setApiKey("");
mapView = MapView(this)
setContentView(mapView)
val map = ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC)
mapView!!.map = map
val table =
ServiceFeatureTable("https://services-eu1.arcgis.com/mXUvYpmRuCvDyiRV/arcgis/rest/services/NRL_PointHigh/FeatureServer/0")
val featureLayer = FeatureLayer(table)
map.operationalLayers.add(featureLayer)
featureLayer.addDoneLoadingListener {
val status = featureLayer.loadStatus
Log.d("MainActivity", "Feature layer load status: $status")
}
}
}
New version 200.X do not work
package com.example.droidarcgisplayground
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import com.arcgismaps.ApiKey
import com.arcgismaps.ArcGISEnvironment
import com.arcgismaps.LicenseKey
import com.arcgismaps.data.ServiceFeatureTable
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.BasemapStyle
import com.arcgismaps.mapping.layers.FeatureLayer
import com.arcgismaps.mapping.view.MapView
import kotlinx.coroutines.launch
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ArcGISEnvironment.setLicense(LicenseKey.create("")!!)
ArcGISEnvironment.apiKey =
ApiKey.create("")
val mapView = MapView(this)
lifecycle.addObserver(mapView)
setContentView(mapView)
val map = ArcGISMap(BasemapStyle.ArcGISTopographic)
mapView.map = map
val table =
ServiceFeatureTable("https://services-eu1.arcgis.com/mXUvYpmRuCvDyiRV/arcgis/rest/services/NRL_PointHigh/FeatureServer/0")
val featureLayer = FeatureLayer.createWithFeatureTable(table)
map.operationalLayers.add(featureLayer)
lifecycleScope.launch {
table.load().onFailure {
Log.e("MainActivity", "Failed to load table", it)
}.onSuccess {
Log.d("MainActivity", "Table loaded")
}
featureLayer.load().onFailure {
Log.e("MainActivity", "Failed to load feature layer", it)
}.onSuccess {
Log.d("MainActivity", "Feature layer loaded")
}
}
}
I sometimes try to test with ArcGIS Runtime SDK Samples
https://apps.apple.com/no/app/arcgis-runtime-sdk-samples/id1180714771?l=nb
but this is still made with 100.X of some reason...
Hi,
You can find more information about the new 200.x samples in the app stores (Apple, Google, and Microsoft) here:
Kotlin: ArcGIS Maps SDK for Kotlin samples | ArcGIS Maps SDK for Kotlin | Esri Developer
Swift: ArcGIS Maps SDK for Swift sample code | ArcGIS Maps SDK for Swift | Esri Developer
.NET: ArcGIS Maps SDK for .NET sample code | ArcGIS Maps SDK for .NET | Esri Developer
Thanks
Hi,
There appear to be some discrepancy in the encoding of the symbols within the service, can you provide more info on how you published this service? (e.g. where did the symbology come from? e.g. the version of ArcGIS Pro did you use to publish?)
Thanks
Mike