|
POST
|
An alternative solution would be to construct the symbol directly from a JavaFX image. If you are already using the image elsewhere in your app for example, you could do this: Image image = new Image("file:FireStation.png", 100, 100, false, false);
PictureMarkerSymbol markerSymbol = new PictureMarkerSymbol(image);
... View more
02-02-2021
02:22 AM
|
1
|
0
|
1484
|
|
POST
|
I can see the issue here. The point you are creating is in the wrong spatial reference. This is how you should be creating the point I believe you want which is a latitude and longitude. graphicPoint = new Point(79.97325625691973,6.91621555958787, SpatialReferences.getWgs84()); You were centring your map based on a latitude and longitude which are angles measures from the centre of the earth in angles of degrees. This is what we call a geographic projection and in this case is called WGS84. Note that in navigation people say latitude then longitude, but in mathematics we say x then y, which of course causes confusion! Note the order of coordinates changed when I specified the point. The coordinate system you were using was a projected coordinate system of which there are lots, but this is a global one called Web Mercator covering rather crudely the entire Earth and not being particularly good good for mapping the North or South Poles! The units of measure here are in metres and measured from an origin which sits in the sea just off the West coast of Africa - very near to where you were placing your point by accident. If you are interested in more details you could read this: https://www.esri.com/arcgis-blog/products/arcgis-pro/mapping/coordinate-systems-difference/#:~:text=A%20geographic%20coordinate%20system%20(GCS,system%20(PCS)%20is%20flat. Also you've got the same issue when setting the ViewPoint. This code should help: mapView.setViewpoint(new Viewpoint(new Point(79.97325625691973,6.91621555958787, SpatialReferences.getWgs84()), 7500)); Does this help?
... View more
02-01-2021
12:32 PM
|
0
|
1
|
2591
|
|
POST
|
If you are working with a file on the local OS, you don't need a full URI format, you can just use the file on its own. I just tried this out with the following code: GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
mapView.getGraphicsOverlays().add(graphicsOverlay);
// An image file on the hard drive.
PictureMarkerSymbol markerSymbol = new PictureMarkerSymbol("./FireStation.png");
markerSymbol.setHeight(100);
markerSymbol.setWidth(100);
markerSymbol.loadAsync();
markerSymbol.addDoneLoadingListener(() -> {
System.out.println("loaded status " + markerSymbol.getLoadStatus());
if (markerSymbol.getLoadStatus() == LoadStatus.LOADED) {
// use the symbol
Point point = new Point(0,0);
Graphic graphic = new Graphic(point,markerSymbol);
graphicsOverlay.getGraphics().add(graphic);
} else {
// error state as it didn't load
System.out.println("Failed to load: " + markerSymbol.getLoadError().getCause());
}
}); Does this work for you?
... View more
01-31-2021
11:32 AM
|
1
|
1
|
1531
|
|
POST
|
Yes this is possible and I can think of a couple of options depending on if you are working on a 2D map (MapView), or a 3D scene (SceneView). Both approaches will need some sort of elevation data which often comes in a raster format (DEM data) where the raster cell values are set to a value related to height instead of a color map. You can perform an identify operation on your layer which contains the elevation data to get the result. There is a sample which shows a raster identify operation on a mouse move here: https://github.com/Esri/arcgis-runtime-samples-java/tree/master/raster/identify-raster-cell The data here I don't believe is DEM data, but it shows you how it works. If you are writing a 3D scene based application, there are specific methods for getting the elevation of a surface. This sample demonstrates this nicely: https://github.com/Esri/arcgis-runtime-samples-java/tree/master/scene/get-elevation-at-a-point If you take a look at the getElevationAsync method in the sample you will see where the elevation is obtained. Does this help?
... View more
01-29-2021
12:54 AM
|
1
|
0
|
1503
|
|
POST
|
@WaelYoussef the ArcGIS Runtime SDK for Java is for writing JavaFX desktop applications. If you want to create a web application where are various options open to you. - JavaSctipt API : https://developers.arcgis.com/javascript/latest/ - One of the builder apps https://developers.arcgis.com/documentation/#arcgis-web-appbuilder Does this help you?
... View more
01-27-2021
09:31 AM
|
1
|
0
|
1110
|
|
POST
|
I can see how this would not be very pleasing to the user. I tried it myself and it feels pretty bad. You'll be glad to hear there is a better way and it's not that complicated. The laggy experience you have here is happening because you are calling an animated change of viewpoint over and over again. The approach here is to change the viewpoint without animation. I've written a method to show how this is done: private void rotateMapView(double angle) {
Viewpoint v = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);
if (angle < 0) {
angle += 360.0f;
}
v = new Viewpoint((Point) v.getTargetGeometry(), v.getTargetScale(), angle);
mapView.setViewpoint(v);
} The next step is to wire this up to the custom interaction you are creating. The best approach is to make your own InteractionListener which you can conveniently create by overriding the DefaultInteractionListener. I started to put one together here to show how it works, but it needs more work as it is not that robust yet. It was created as a class within the application class: private class rotationInteractionListener extends MapView.DefaultInteractionListener {
private double initialX;
protected rotationInteractionListener(MapView mapView) {
super(mapView);
}
@Override
public void onMousePressed(MouseEvent e) {
initialX = e.getX();
System.out.println("custom pressed");
super.onMousePressed(e);
}
@Override
public void onMouseDragged(MouseEvent e) {
double xDiff = initialX - e.getX();
rotateMapView(xDiff);
System.out.println("custom pan " + xDiff);
e.consume();
//super.onMouseDragged(e);
}
} To attach the new listener to your mapview you need to add this: // create a map view and set its map mapView = new MapView(); mapView.setMap(map); //Instantiate custom interaction listener and assign it to the mapview InteractionListener interactionListener = new rotationInteractionListener(mapView); mapView.setInteractionListener(interactionListener); You should this solution much less laggy. Does this help?
... View more
01-22-2021
06:27 AM
|
1
|
1
|
2151
|
|
POST
|
It is worth reading this document too https://developers.arcgis.com/android/latest/guide/reducing-your-apk-size.htm
... View more
01-18-2021
04:15 AM
|
0
|
4
|
5262
|
|
POST
|
I have had some instances when the service hasn't loaded. I basically wasn't getting a response from the server and it timed out. The code sample above could be made more robust by checking the load status of the feature layer. featureLayer.loadAsync()
featureLayer.addDoneLoadingListener {
//Toast.makeText(this, "loaded", 3)
if (featureLayer.loadStatus == LoadStatus.FAILED_TO_LOAD) {
Toast.makeText(this, "failed to load " + featureLayer.loadError.message, Toast.LENGTH_SHORT).show()
} else {
Toast.makeText(this, "loaded okay", Toast.LENGTH_SHORT).show()
val extent: Envelope = featureLayer.getFullExtent()
mapView.setViewpointGeometryAsync(extent)
}
}
... View more
01-18-2021
04:06 AM
|
0
|
0
|
3544
|
|
POST
|
The screenshot in my previous post was grabbed from running it in a desktop Java Runtime app which was for convenience. I does however work on in my Kotlin Android app too. This is the modified onCreate method from my app: override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// create the service feature table
val serviceFeatureTable = ServiceFeatureTable("https://hbsyb.booway.com.cn/arcgis/rest/services/zjsxyd/sichuanxianjixingzhengqu/MapServer/0");
// create the feature layer using the service feature table
val featureLayer = FeatureLayer(serviceFeatureTable)
// create a map with the terrain with labels basemap
ArcGISMap(Basemap.createTerrainWithLabels()).let { map ->
// set an initial viewpoint
//map.initialViewpoint = Viewpoint(
// Point(
// -13176752.0,
// 4090404.0,
// SpatialReferences.getWebMercator()
// ), 500000.0
//)
// add the feature layer to the map
map.operationalLayers.add(featureLayer)
featureLayer.loadAsync()
featureLayer.addDoneLoadingListener {
val extent: Envelope = featureLayer.getFullExtent()
mapView.setViewpointGeometryAsync(extent)
}
// set the map to be displayed in the mapview
mapView.map = map
}
} This zooms to the extent of the layer once it is loaded and on my Samsung phone looks like this: If you use my code, does this work for you?
... View more
01-18-2021
03:46 AM
|
0
|
0
|
3544
|
|
POST
|
I've tried adding your feature later to a map using our latest release (100.9.0) and it displayed without any issues. I was basically swapping your service into this app on github: https://github.com/Esri/arcgis-runtime-samples-android/tree/master/kotlin/feature-layer-feature-service I had to zoom to a different area, but I could see your data: Does using this code help?
... View more
01-14-2021
03:44 AM
|
0
|
2
|
3587
|
|
POST
|
Specifying a minimum spec for a SDK isn't easy. It really depends on the data you are using and how you are using it. Theoretically if your laptop supports DirectX 11 (assuming here you are deploying to Windows platforms) it should work. A simple map application which has a basemap and a few dots on it will work on some pretty low specification machines. If however you write an app which does intensive 3D visualisation, or even a 2D app which is displaying thousands of points or polygons all updating their location 50 times a second you are going to struggle with a low end GPU. If resources are an issue with the device you are deploying to there are things you can do in code to make better use of the hardware. You mention use are using graphics overlays, so a starting point could be to play around with the Rendering mode for your graphics overlays (STATIC mode may help). https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/GraphicsOverlay.RenderingMode.html You also mention marker symbols. If you are displaying lots of graphics then if you use a Renderer for your symbols (Unique Value Renderer for example), this will save you some texture memory on your graphics card if you are currently creating a symbol for each graphic. Sometimes writing an app for a low end device requires careful coding to make efficient use of limited resources.
... View more
01-12-2021
03:42 AM
|
2
|
0
|
8418
|
|
IDEA
|
I'm currently reviewing this as part of a release planning process and was wondering if a suitable solution here is to simply add another graphics overlay to your application? Although the Sketch Editor used a graphics overlay internally, the MapView control can support multiple graphics overlays, so there is nothing to stop you creating another one to display the symbols you've described above. Would this workflow work for you? Theoretically we could expose the graphics overlay we use internally with the sketch edit, but there is a very big risk that if external code edits the contents it would result in instability of the editor operations.
... View more
01-07-2021
02:31 AM
|
0
|
0
|
2093
|
|
POST
|
I've talked more to the geometry engine team about this issue and this will be resolved eventually by the creation of a new set of geometry operations which will support 3D operations. This isn't something which is currently under development, but if you wanted to raise the profile of this then I would suggest that you enter a request in the Ideas section: https://community.esri.com/t5/arcgis-runtime-sdks-ideas/idb-p/arcgis-runtime-sdks-ideas If you enter something here, I'll raise it with the team so it can be considered for a future release.
... View more
01-07-2021
02:16 AM
|
0
|
1
|
2881
|
|
POST
|
ENC is safety critical data and if there is an update we will automatically show the latest data. We don't have any specific API to show the details of the update information, but I can only assure you that the API will display the latest chart.
... View more
01-05-2021
01:38 AM
|
0
|
0
|
1455
|
|
POST
|
The files on Bintray are no longer available as jFrog have deprecated this service. You'll be glad to hear that we have already addressed the issue and details can be found here: https://community.esri.com/t5/arcgis-runtime-sdks-blog/announcement-to-developers-using-cocoapods-with-arcgis-runtime/ba-p/1009911
... View more
01-05-2021
01:32 AM
|
3
|
0
|
3046
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-12-2026 01:35 AM | |
| 2 | 05-07-2026 06:59 AM | |
| 1 | 08-13-2024 05:17 AM | |
| 1 | 07-10-2024 01:50 AM | |
| 1 | 04-22-2024 01:21 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-13-2026
06:46 AM
|