POST
|
Hi, This is the problem with Graphic object. The object can have a Map of data that can be retrieved when the user clicks on the drawn Graphic on the map. One of the constructor of the Graphic class has a parameter with type Map<String, Object> to store data, but somehow, when I retrieved it using Graphic.getAttributes() and access the value inside the Map, it returns a string (or ClassCastException when I try to cast it to an object of desired type, which of course, is derived from Object class) It seems that the method cast all the Map values into string (maybe using toString() method). This is quite problematic, especially when the user wants to put a custom Object type to the Map as value. The Graphic object should be able to store and return back the object without changing it to String HashMap<String, Object> data = new HashMap<String, Object>() MyObject obj = new MyObject(); data.put("data", obj); Graphic g = new Graphic(point, image, data); MyObject selected = (MyObject) g.getAttributes().get("data"); // Exception here
... View more
11-25-2016
05:15 AM
|
0
|
8
|
1408
|
POST
|
I have 4 TPK files whose bounds are intersecting with each other. I can assure you, based on the MapView display and my current coordinate, that they are placed correctly.If I load the TPK files with online basemaps, it will surely display the correct location of the markers (because there is a network connection)
... View more
11-23-2016
05:50 AM
|
0
|
0
|
501
|
POST
|
The marker was showing up in the correct location when it's online. The projection was done correctly. I have always transformed the lat-lon values into the map's spatial reference (using GeometryEngine.project()). The problem was that the map might not be (or is currently initializing) initialized with offline features due to huge size of tpk file (over 600MBs). Therefore, it might cause the projection to fail and the transformed lat lon falls back to the default/invalid coordinate ( the coordinate that shows up on top of the sea southwest of the Africa continent). When I added a small 1s-ish delay, it shows up on the correct position Not only markers, but map centering (MapView.centerAt() method) does not work when the map is still initializing (with offline features) I had an offline tpk file of Darmstadt city, Germany, and was trying to put a marker on top of Luisenplatz
... View more
11-23-2016
05:35 AM
|
0
|
2
|
501
|
POST
|
Okay, this is just silly. I manage to fix this by adding a bit of delay to marker drawing after the addition of offline tpk files. My tpk file size is around 600MBs, so the markers may have not the correct drawing info, because the offline maps took a while to be initialized
... View more
11-23-2016
02:10 AM
|
0
|
0
|
501
|
POST
|
Hi, I am currently trying to draw markers on top of an offline tilemap provided by a tpk file. The problem is, the position of the marker is different from the actual lat lon. I have setup the lat lon of the marker somewhere in a city on top of the offline tilemap (I have checked that the lat-lon is valid), but it shows up on the sea (or grids. Anyway, it is outside the tilemap). The strange thing is, when I use network connection, the marker shows with the correct position on the map. I have been wrecking my brain for a day to solve this. Thanks before
... View more
11-23-2016
01:08 AM
|
0
|
5
|
1088
|
POST
|
The MapOptions is actually still there. But I got everything working now. You just need to check if the internet connection is not available, then add offline features (e.g. tpk files) and it will initialize itself (Don't check for status INIT_SUCCESS). The MapOptions attribute is still useful for when I have slow/unreliable connection, so I don't have to programmatically change the basemap The solution is to always add any offline features to actually initialize the map when offline (kudos to Alexander) Thank you for the reply.
... View more
10-28-2016
03:59 AM
|
0
|
0
|
328
|
POST
|
I will try this tomorrow, as I am currently not on my workspace. I'll also provide a sample tpk I used for this EDIT: I tried loading the .tpk directly when offline and not using the OnStatusChangeListener. It shows the grid and offline map without internet connection. I cannot help but wonder, that u need to load any offline features just to get the map started. In my opinion, it should have started regardless whether you have any offline features or not (and by then you can dynamically add more offline features on the run, not adding 1 or all of them on first init). EDIT2: Now came another problem. I have some TPK files that are spread across a country. The problem is, I cannot pan the map to other location other than my location. E.g. My last position is at Kansas and I have 3 TPK files for Colorado, Oklahoma, and Arizona. I cannot scroll or pan my map to Oklahoma or Arizona because it's quite far from my current position. It seems that there's this invisible boundary that limits my panning EDIT3: last edit. Finally got it working. I just need to programamtically set the max extent of the map using MapView.setMaxExtent(). I took the (xmin,ymin) and (xmax, ymax) from ArcGIS street map's REST API and now I could navigate to any location on the map
... View more
10-27-2016
10:03 AM
|
0
|
0
|
1758
|
POST
|
I have some .tpk files that I manage to load by selecting them from a list. Whenever the map is blank (no internet connection), the .tpk file was not shown on the map. If it has internet connection, the grid shows up and the selected .tpk file can be shown correctly. What kind of datasets are we talking about? The stuff I did after the initialization (which is now moved outside the OnStatusChangedListener), which is related to the MapView, is just adding Graphics Layer for marker and regions, and turning on the location listener. EDIT: Can u also provide me the XML file you use for that example? Thank you
... View more
10-27-2016
09:04 AM
|
0
|
3
|
1758
|
POST
|
I have checked on my code. There's no basemap URL included there. Without Wifi or internet connection, it fails to initialize the map. I put all of the map setup code inside the if (status == STATUS.INITIALIZED) block, so it doesn't load up properly due to the calling IF statement is false. I have tried moving it out of the IF block (so it will initialize the map regardless of the status change), but it's still the same old black map (doesn't even show the grids).
... View more
10-26-2016
11:42 PM
|
0
|
5
|
1758
|
POST
|
The WKT is in a form of string. There's already a library that can parse a WKT string, but only available in Javascript. Wicket - Lightweight Javascript for WKT [Sandbox] That's an example string of a multipolygon (You can just replace the coords wit lat-lon). There're several geometries supported by WKT, such as points, polygons, lines, up to complex geometries like curve, Polyhedralsurface, etc. It will be a nice addition if the SDK could: - Parse WKT string into a ready-made object - The said object can be directly drawn onto the map - Several utility methods such as determining if a point is inside a region, if 2 regions collide with each other, etc. Sadly, I am not at my workspace right now, so I can just give that much
... View more
10-25-2016
12:31 AM
|
1
|
1
|
1038
|
POST
|
I am inflating the map from XML and I don't include any basemap URL in the XML. It's just a MapView with usual id, width, height, mapOptions set to Street and zoom set to 15. No basemap URL The STATUS.INITIALIZED is not triggerred on the code. Instead, without internet connection, it will give you something like "Init failed". I am not on my workspace right now. I will provide better explanation once I get there.
... View more
10-25-2016
12:24 AM
|
0
|
5
|
1758
|
POST
|
Hi, I have a text file consisting a Well-Known Text (WKT) string. The WKT string will be used to define regions (basically, list of lat-lon) where I would draw it onto the MapView. Can the Android's ArcGIS SDK parse the WKT and draw the region defined by the string? If so, which class to use and how should I use it? Thanks before
... View more
10-21-2016
10:14 AM
|
0
|
3
|
2621
|
POST
|
Hi, I am currently building an Android App using ArcGIS runtime SDK for Android. The app has a MapView on the layout and I plan to make it work offline without wifi. Thus, I have provided myself several .tpk files as offline areas. Under working WiFi connection, it worked well (the map is displayed, along with the offline tiles). But, when I turned off the WiFi and restarted the app, it only shows blank (black) map I used the OnStatusChangedListener to listen to the MapView status. Here is the code snippet mapView.setOnStatusChangedListener(new OnStatusChangedListener() {
@Override
public void onStatusChanged(Object o, STATUS status) {
//initialization
if (o == mapView && status == STATUS.INITIALIZED){
//setup everything, including adding offline maps here
//... I was under impression that the INITIALIZED status requires connecting to the internet. That's why I couldn't use the map or anything because I ran it without the WiFi turned on. If that's the case, how can I use the MapView without using internet connection, when initializing the map itself requires internet connection? Is it actually one of the limitation of the SDK? THX before
... View more
10-21-2016
05:25 AM
|
0
|
13
|
3535
|
POST
|
Hi, I am currently developing an application using ArcGIS runtime SDK for Android. I used the ArcGIS' routing service from this URL: http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World and so far, I've managed to retrieve and draw a route between 2 or more stops. The problem is, each time I resolve a route search, it appears to always include highways and big streets in the route. Each stops in the app can be reachable by foot (app design constraint), and thus, I would like to resolve a route that prefers small streets and avoid highways whenever possible. What I've done: Getting the list of CostAttributes from routeTask.getNetworkDescription().getCostAttributes(); and set the impedance to 'walkTime', 'distance', etc. by calling RouteParameters.setImpedanceAttributeName(); Not working, still getting the same route Followed the example from:Finding a Route—ArcGIS Runtime SDK for Android | ArcGIS for Developers Followed another example: Routing | ArcGIS for Developers Set setFindBestSequence(true). I noticed later that it uses Travelling Salesman Problem and is not what I'm looking for. Is there other options in route parameters, which I am unaware of, which can be used to set the travel mode? or other things that may solve my problem Thanks before
... View more
05-19-2016
06:13 AM
|
0
|
0
|
3114
|
POST
|
It seems that the link to the map is not correctly shown : http://maps.omniscale.net/v2/mobilemenschen-a4e73fda/style.default///.png On Thu, May 5, 2016 at 11:48 AM, Jason Christian <
... View more
05-05-2016
02:52 AM
|
0
|
0
|
1512
|
Title | Kudos | Posted |
---|---|---|
1 | 10-25-2016 12:31 AM | |
1 | 10-10-2017 06:52 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|