POST
|
Hi Gunther, I have changed the code as per your suggestion, and it looks improved but still i have encountered a crash once during testing. here is the changed code : navigation changed listener : _mapView.addNavigationChangedListener(
navigationChangedEvent -> {
if (!navigationChangedEvent.isNavigating()) {
System.out.println("navigating");
if (_mapView.getMapScale() < 50000) {
mCurrentEnvelope = _mapView.getVisibleArea().getExtent();
// getBusStopsList();
if (mLoadStopsTask != null
&& !mLoadStopsTask.isCancelled()
&& mLoadStopsTask.getStatus() != AsyncTask.Status.FINISHED) {
mLoadStopsTask.cancel(true);
}
mLoadStopsTask = new LoadBusStopTask();
mLoadStopsTask.execute();
}
}
}); Async task which calls getBusStopsList() : private class LoadBusStopTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... voids) {
getBusStopsList();
return null;
}
} Retrofit call : private void getBusStopsList() {
System.out.println("calling busstops api ");
Envelope envelope = mCurrentEnvelope;
mBusRouteManager.getBusStopsList(
envelope.getXMin(),
envelope.getYMin(),
envelope.getXMax(),
envelope.getYMax(),
Darb.getLanguage(),
new BusRouteManager.BusStopsListener() {
@Override
public void onSuccess(List<PTStop> ptStopList) {
System.out.println("recieved " + ptStopList.size() + " stops");
if (ptStopList.size() > 0) {
for (int i = 0; i < ptStopList.size(); i++) {
busStopHashMap.put(STOP_NAME, ptStopList.get(i).Name);
busStopHashMap.put(STOP_ID, ptStopList.get(i).Id);
busStopHashMap.put(STATELESS, ptStopList.get(i).Stateless);
busStopHashMap.put(STOP_DISPLAY_ID, ptStopList.get(i).DisplayId);
busStopHashMap.put(LAT, ptStopList.get(i).getLocation().getX());
busStopHashMap.put(LON, ptStopList.get(i).getLocation().getY());
busStopHashMap.put(OVERLAY_TYPE, BUS_STOPS_OVERLAY);
Point graphicPoint =
new Point(ptStopList.get(i).getLocation().getX(), ptStopList.get(i).getLocation().getY());
Graphic stopGraphic =
new Graphic(
graphicPoint,
busStopHashMap,
busStopSymbol);
mBusStopsGraphicsOverlay.getGraphics().add(stopGraphic);
}
}
}
@Override
public void onFailure(String message) {
mDisplayUtils.showToast(message, MapActivity.this, Toast.LENGTH_SHORT);
}
});
} please do provide a solution, as we cannot release the app with this bug we have official license for SDK and Arc Pro products,its also possible for us to request a official help if required..please direct.
... View more
09-23-2019
04:11 AM
|
0
|
0
|
598
|
POST
|
Hello All, We are migrating out android app from 10.12 to 100.5.0, though almost 90% is completed. we have encountered a serious performance problem which leads to ANR and getting stuck of map view. So here is the problem : We have a rest API (normal json based,not feature layer) which expose an array of geo locations.our requirement is such that we have to call this api whenever the user moves or pans the map and draw the overlay of points (from the api response )in the current visible extent of the map using graphics overlay. I have tried viewpointchangelistener() on the map view,the problem with that is the callback gets triggered so often,which results in unwanted api calls.also i have read from the document that this is not right place to do long operation. then i have switched to navigationchangedlistener() and call the api if the map is not currently navigating on the current visible extent, though this has improved the performance considerably, still we have the problem. here is the code that i use : my navigation changed listener : _mapView.addNavigationChangedListener(
navigationChangedEvent -> {
if (!navigationChangedEvent.isNavigating()) {
System.out.println("navigating");
if (_mapView.getMapScale() < 50000) {
mCurrentEnvelope = _mapView.getVisibleArea().getExtent();
getBusStopsList();
}
}
}); method which calls the API - getBusStopsList() : private void getBusStopsList() {
System.out.println("calling busstops api ");
Envelope envelope = mCurrentEnvelope;
mBusRouteManager.getBusStopsList(
envelope.getXMin(),
envelope.getYMin(),
envelope.getXMax(),
envelope.getYMax(),
getLanguage(),
new BusRouteManager.BusStopsListener() {
@Override
public void onSuccess(List<Stop> ptStopList) {
System.out.println("recieved " + ptStopList.size() + " stops");
if (ptStopList.size() > 0) {
for (int i = 0; i < ptStopList.size(); i++) {
busStopHashMap.put(STOP_NAME, ptStopList.get(i).Name);
busStopHashMap.put(STOP_ID, ptStopList.get(i).Id);
busStopHashMap.put(STATELESS, ptStopList.get(i).Stateless);
busStopHashMap.put(STOP_DISPLAY_ID, ptStopList.get(i).DisplayId);
busStopHashMap.put(LAT, ptStopList.get(i).getLocation().getX());
busStopHashMap.put(LON, ptStopList.get(i).getLocation().getY());
busStopHashMap.put(OVERLAY_TYPE, BUS_STOPS_OVERLAY);
Point graphicPoint =
new Point(ptStopList.get(i).getLocation().getX(),
ptStopList.get(i).getLocation().getY());
Graphic stopGraphic =
new Graphic(
graphicPoint,
busStopHashMap,
busStopSymbol);
mBusStopsGraphicsOverlay.getGraphics().add(stopGraphic);
}
}
}
@Override
public void onFailure(String message) {
mDisplayUtils.showToast(message, MapActivity.this, Toast.LENGTH_SHORT);
}
});
} This method internally makes a retrofit call to the api and onSuccess loops through the list and add the graphic to the overlay. also this triggers lot of Garbage collecting activities and the respective logs gets printed in logCat. when the app gets stuck, because of this issue. i get log saying that its tombstoned I am sure that the issue is because of this method, when i comment this method from executing everything runs smoothly. The same methodology was used in 10.2.9 which was working perfectly fine (we have earlier used scalechangedlistener() ) Please suggest some better approach regarding this issue.
... View more
09-11-2019
03:40 AM
|
0
|
3
|
702
|
POST
|
Thanks tyler, but what if i have more than one graphicsoverlay.. how do i differentiate them? i mean how do i identify the tap on group of graphic layers in graphic overlay in the map ?
... View more
09-02-2019
10:12 PM
|
0
|
1
|
1352
|
POST
|
Hey People at Esri,This issue is so intimidating ... kindly please adress the issue
... View more
09-01-2019
12:42 AM
|
0
|
0
|
393
|
POST
|
Hi all, i use arcgis android 100.5 to load and query the layer. but often i get this error : java.util.concurrent.ExecutionException: com.esri.arcgisruntime.ArcGISRuntimeException: Cannot call this method in this context please help,this is my code public static void queryLayer(
ServiceFeatureTable serviceFeatureTable, MapActivity.LayerQueriedListener listener) {
serviceFeatureTable.loadAsync();
serviceFeatureTable.setCredential(Utilities.getUserCredentials());
serviceFeatureTable.addDoneLoadingListener(
() -> {
QueryParameters queryParameters = new QueryParameters();
ListenableFuture<FeatureQueryResult> future =
serviceFeatureTable.queryFeaturesAsync(
queryParameters);
future.addDoneListener(
() -> {
try {
FeatureQueryResult result = future.get();
Iterator<Feature> featureIterator = result.iterator();
if (featureIterator.hasNext()) {
Feature feature = featureIterator.next();
listener.onLayerQueryCompleted(feature.getGeometry());
}
} catch (ExecutionException | InterruptedException e) {
System.out.println("Error querying service table :" + e.getCause());
}
});
});
} the issue is so annoying,pls address
... View more
08-31-2019
11:28 PM
|
0
|
1
|
684
|
POST
|
so if we need to have 2 separate identifiers to identify graphics and features, i think it would be a unoptimized solution, what if i click on graphics only, in this scenario..the other layers which are on the map are getting queried for no use right ?
... View more
08-06-2019
10:06 PM
|
0
|
3
|
1352
|
POST
|
Hello everyone, in my app,i have scenario where i show feature layer with some points.i have created a class that extends defaultmaptouchlistener to handle tap events. this works fine without an issue. in some cases,my map may also have some graphic overlays which also need to be tap recognized,the problem is that the tap listener fails to recognize tap events on graphic overlays.. how do i create a single taplistener that works both for feature layer points and graphic overlays?
... View more
08-04-2019
09:31 PM
|
0
|
5
|
1772
|
POST
|
I have a webservice in which I get list of items as json,i need to create a feature layer locally from the data available in the json, how do i approach this ? i use android sdk 100.5.0 thanks in advance.
... View more
08-01-2019
03:04 AM
|
0
|
0
|
217
|
POST
|
hello eric do you have any plan to release support for vaadin ? if not please consider this i dont think it will be a difficult task as you have already support for swing.
... View more
10-31-2018
04:14 AM
|
1
|
0
|
576
|
POST
|
Recently a security audit has been done on our servers and applications which has ArcGIS enterprise installed on it. Our Architecture setup : We have ArcGIS installed on the server, ArcGIS exposes its data via its restful api for its clients which is authenticated with OAuth2 token security (Out of the box ESRI Feature) We have mobile applications for both iOS/Android and web which are built on top of ESRI SDK’s.some of the features in the app consumes data from ArcGIS rest services for their functioning. The audit reported a potential vulnerability stating that one of the rest service disclose sensitive informations including email and phone numbers even for non authenticated users. consider web application, we make use of esri’s proxy files to manage access to our resources for them. the vulnerability is found for the following feature server query through the rest interface, /webapp/proxy/proxy.ashx?https://www.site.com/ArcGIS/rest/services/PublicPortal/xxxxxx/FeatureServer/0/query?f=json&where=EMAIL%20IS%20NOT%20NULL&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=* I understand this as a problem with the ArcGIS rest services, but I’m not sure about this, if some one could, please clarify the following points 1)what could be done to mitigate this problem. Kindly please help.
... View more
10-30-2018
09:12 AM
|
0
|
0
|
691
|
POST
|
Hello All, As of know,i see the Java API examples are demonstrated with either swing or javafx. we're planning to build an map app using vaadin with esri's java api for the web we're not using JS api. vaddin support esri-leaflet via a plugin please give more details on this..
... View more
09-30-2018
08:37 PM
|
0
|
2
|
911
|
POST
|
Hello, how do i rotate the mapview so that the driving path always become straight to the user(like in google maps) in esri android and ios
... View more
09-25-2018
10:08 PM
|
0
|
2
|
816
|
POST
|
Great information Nick, Thanks for your detailed response..I'll use AGSQueryTask, also,Jake's information was valuable..
... View more
09-24-2018
10:44 PM
|
1
|
0
|
1050
|
Title | Kudos | Posted |
---|---|---|
3 | 05-08-2018 11:42 PM | |
1 | 10-31-2018 04:14 AM | |
1 | 05-16-2018 01:13 AM | |
1 | 09-24-2018 10:44 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|