|
POST
|
Hi Keith, I have reproduced this and found that this changed between 10.2 and 10.2.2 - in 10.2 I see both pre and post up move events, at 10.2.2 and 10.2.3 I don't get postPointerUp, but I do get prePointerUp when my pan action ends in a fling gesture (perhaps this explains why you sometimes saw this called and sometimes not). I will submit an issue about this change, although I cant say at this point when a fix may happen, I do know there has been a number of changes over the last few releases with gestures in the map. As a partial workaround, I have found that if I set a MapTouchListener in MapView.setOnTouchListener, I reliably get the ACTION_UP MotionEvent action called - this is called before the pan listener prePointerUp (when that happens). There is no equivalent to the postPointerUp in this listener though. Hope this helps a bit,
... View more
05-21-2014
02:40 AM
|
0
|
0
|
747
|
|
POST
|
Glad you got things working, thanks for posting back about reprojecting the extent too, that's a useful thing to highlight for any others dealing with similar situations.
... View more
05-06-2014
01:18 AM
|
0
|
0
|
725
|
|
POST
|
Hi Brian, You will need to ensure that when you download the features from the feature service to the local geodatabase, that you specify the spatial reference you want - in this case you'll want it to match the tiled offline layer you're using as the basemap. You can use the setOutSpatialRef method on the GenerateGeodatabaseParameters class to set the spatial reference of the geometries in the new geodatabase, when you generate the geodatabase using a GeodatabaseSyncTask. I found that we don't have any documentation highlighting this (beyond the statements that this is possible), and we need to highlight when you want to be using this ability, so will make sure this is addressed for the next release. BTW - when you add the offline feature layer to the map first, the reason you can see your features then is that the first layer added sets the spatial reference of the map. You'll find that you cant see the tiled layer if you add that afterwards, if it doesn't match the spatial reference of the first layer. Hope this helps,
... View more
05-02-2014
03:47 AM
|
0
|
0
|
725
|
|
POST
|
I'd have to guess that there is nothing wrong with how you get the X and Y back from the geometry of the graphic - the geometry of a graphic does not change after it is created - so what were the X and Y values you got from the geometry, and what were the X and Y values of geometry when you created the Graphic initially? And what were you expecting the X and Y of the geometry to be?
... View more
04-30-2014
01:00 AM
|
0
|
0
|
1945
|
|
POST
|
So are you successfully getting the X and Y / latitude and longitude of your Graphic now? If your first question is solved and you have a follow up question, it would be best if you post a new question on the forum - that way the title of your new post will hopefully find people who know about this second problem (I'm afraid I don't know the solution to this second problem). Also, when you post your follow up, it would be great if you post at which line of code you actually get the exception.
... View more
04-28-2014
12:55 AM
|
0
|
0
|
1945
|
|
POST
|
Hi, From a Graphic, you can use getGeometry() - in your code here the Geometry should be a Point, because the addMarkerGraphic method takes X,Y the coordinates you passed in and turns this into a Point to use in the Graphic. It's best to check the Graphic.getGeometry() is a Point of course, just in case you end up with other types of graphics that have polygons or lines. Then from the Point you can use getX() and getY() to get coordinates - in your code it looks like your graphic was initially created with lat,long coordinates, so the X will represent the longitude and the Y will represent the latitude. (Note that if you created your point initially with some other types of coordinate (e.g. the point is in a projected coordinate system) then you can use the GeometryEngine.project method to project the Point to use, for example, WGS 94 geographic coordinate system, and then get the X and Y from the projected point.) Hope this helps,
... View more
04-25-2014
01:42 AM
|
0
|
0
|
1945
|
|
POST
|
Great, glad we're helping somewhat - it can be quite a lot to understand when you first start of, how all the pieces fit together. I don't suppose you might also be able to direct me to some documentation or tutorial on how I can now make that layer editable to the user or allow them to add features if they choose So there's two parts to that - and the first bit you already did, which is make sure the hosted service is editable. You do not need to add a separate GraphicsLayer, you can use the class you are already using, ArcGISFeatureLayer. A graphics layer has a lot in common with the ArcGISFeatureLayer (which actually inherits GraphicsLayer), but GraphicsLayer is not connected to a feature service (you make the graphics up yourself), whereas the ArcGISFeatureLayer is connected to the service and features come from the service. You'll see that the methods on ArcGISFeatureLayer that deal with the individual 'features' in the layer actually use take or return Graphic objects, so possibly this is where you were thinking a GraphicsLayer was required - read this for more info: http://developers.arcgis.com/android/guide/features-and-graphics.htm The second part is to actually add functionality to your app in Android to allow users to edit, which is a little bit more involved than just displaying. I would start by reading the topics under 'Edit Data' in the Guide: http://developers.arcgis.com/android/guide/what-is-editing-.htm There are separate topics listed here for creating (adding) new features, and for editing existing features geometry and/or attributes. http://developers.arcgis.com/android/guide/creating-new-features.htm - you basically need to give a way for the user to set the geometry of the feature, and the values of any attributes, and then send the new feature to the service by calling the applyEdits method and passing in the feature. http://developers.arcgis.com/android/guide/editing-existing-geometries.htm - For editing existing features, you need to get hold of the feature you want to change, make the changes to the geometry that you want, and then again pass the changes to applyEdits. https://developers.arcgis.com/android/guide/attribute-editing.htm - Similar to editing the geometry of existing features, only the difference is how the user enters attribute values is different to how they would define a geometry. I'd also recommend trying out this sample: http://developers.arcgis.com/android/sample-code/attribute-editor/ This shows one way of letting users change attributes of existing features in a service. I would try changing this to point to your own service and see how that works. There is also a Geometry Editor sample, but note that one uses 'feature templates' - I noticed you dont have templates in your service, so that's maybe a step more complicated than you need at this point, but the reading the code should give you an idea how to let users add features anyway. There's also another thing to consider, that we are introducing new ways of working with feature services - if you are working with 10.2 then all the above info is basically the way to go. But if you are working with 10.2.2 or intend to update to that or new releases, there is the 'GeodatabaseFeatureServiceTable' which is the new way of showing feature services, and dealing with editing of those service. However its still being worked on, so for a small project you can probably stick with the ArcGISFeatureLayer for now and get things working that way - you can always change your code later if the project has longevity. Some info about the upcoming release is here: http://blogs.esri.com/esri/arcgis/2014/04/04/get-ready-for-the-next-release-of-the-arcgis-runtime-sdks/. Hope that helps, quite a lot of info, but it should be fairly straightforward to get some code working once you know what you're aiming at - let us know how you get on.
... View more
04-16-2014
01:13 AM
|
0
|
0
|
1269
|
|
POST
|
Hi, When you say "wasn't able to access my organizations server to do so....", I'll take that as you don't have a separate ArcGIS for Server installation somewhere, you're talking about using hosted serviced via ArcGIS.com. With the hosted service I think you have a choice of tiled map service, or feature service - http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm#ESRI_SECTION1_5E584527C2BE44BB848B875F47B0434A. The option for a dynamic map service is only available if you have your own ArcGIS for Server installation, sorry for any incorrect or misleading comments previously (I would go back to edit to make sure it's clear for others reading the thread but only last post is editable). So as before, you can use a different class called ArcGISFeatureLayer to add these services to your Android app, e.g. MapView map = (MapView) findViewById(R.id.map);
ArcGISFeatureLayer featureLayer = new ArcGISFeatureLayer("http://services1.arcgis.com/ZIL9uO234SBBPGL7/arcgis/rest/services/OaklandLandmarkPtsPly/FeatureServer/1", ArcGISFeatureLayer.MODE.ONDEMAND);
map.addLayer(featureLayer); The code above works for me. I saw these services have been published with editing capability, so I was able to add a new landmark to the service you published.
... View more
04-15-2014
01:31 AM
|
0
|
0
|
1269
|
|
POST
|
Hi Gina, I re-read your post - when you say you have access to a server through your organization - is that an on-premises server physically on your companys network? If you have an on-premises ArcGIS for Server that's hosting your data, people outside your company firewalls may not be able to see that server. Is that the case? Or are you using ArcGIS Online to host your data, and have an organization account on this which is hosting your data - if you share that hosted data publicly, then it should be accessible to anyone without login. A tip is if the URL of the services has a string of randome alphanumerics in it then it's probably not on-premises. E.g. here's the URL of a service I have hosted and made public on ArcGIS Online: http://services1.arcgis.com/BOEfX71Wt2oRBpkR/arcgis/rest/services/Mountains1/FeatureServer/0 And here's the URL of a service on an ArcGIS for Server machine that is accessible publicly on the internet: http://sampleserver6.arcgisonline.com/arcgis/rest/services/EmergencyFacilities/MapServer Try adding either of these as a layer in code - I dont have any hosted dynamic map services, so for my service it would need to be added in an ArcGISFeatureLayer instead. Perhaps you can post the publicly accessible URL of your service so others can check if the URL is accessible? If so, then you should definitely be able to have anyone open your android app and see the map without needing to login or anything.
... View more
04-08-2014
01:22 AM
|
0
|
0
|
1269
|
|
POST
|
Hi Gina, If your content is not public, then you'll need to log in to authenticate an app with the portal. You could start with trying out this sample: https://developers.arcgis.com/android/sample-code/featured-user-group/ This shows how you can log in and then retrieve content, and then go on to open a map. This sample has hardcoded credentials, but if you want to put some code for logging in into your own app, then you can read this topic: https://developers.arcgis.com/java/guide/use-oauth-2-0-authentication.htm And try out this sample: https://developers.arcgis.com/android/sample-code/oauth2/ You could check the layer initialization to see if you get errors about not being able to access the layer you are loading - look at the MapView.setOnStatusChangedListener method and the OnStatusChangedListener interface: https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/event/OnStatusChangedListener.html Hope this helps
... View more
04-04-2014
12:49 AM
|
0
|
0
|
1269
|
|
POST
|
Perhaps you don't really need a custom Layer, as the GraphicsLayer might do everything you need. Take a look at this sample that converts a CSV file to a GraphicsLayer in a map by connecting to a URL, parsing the CSV file that contains coordinates and attributes into Graphic objects, adds these Graphics to a GraphicsLayer and adds the layer to a map: http://developers.arcgis.com/android/sample-code/addcsv-file/ Whether this is suitable or not depends on what kind of functionality you need in the layer really - you can add and remove graphics, change graphics, change visibility, and get graphics based on screen coordinates. See the JavaDoc for more info: https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/GraphicsLayer.html
... View more
04-01-2014
01:33 AM
|
0
|
0
|
408
|
|
POST
|
Hi Patrick, The Android API jars have already been optimised with Proguard during production, so we do not recommend any further optimisation. Esri uses Proguard for obfuscation purposes but we have deliberately not applied optimisation to this process, due to the concern that this can lead to bugs that are hard to solve. More information can be found here: http://tools.android.com/recent/proguardimprovements "Dalvik performs many of its own optimizations, and some of the optimizations performed by ProGuard are incompatible with Dalvik, so to avoid hard-to-figure-out bugs (and because the net performance gain is usually small), the default configuration turns off optimization." Hope this info is somewhat useful, perhaps you can post back with more info on the size limits you are trying to hit? Regards Shelly
... View more
04-01-2014
12:38 AM
|
0
|
0
|
689
|
|
POST
|
Hi Mike, I appreciate it can be really frustrating trying to understand a new system, hopefully we can help out with this simple request though. Many years ago, his organization created a bike route map for his region. He has exported it, send it to me and said, "Put this on the Android app I'm having you develop." His export resulted in the following files: .dbf, .shp, .prj, .spn, .spx, .xml, and .shx files. What you have there is a shapefile - historically a rather old Esri format for geogaphic data - the 'shapefile' means basically at the very least the .shp, .shx and the .dbf files together (the other files are used by some bits of the system and not by others, but generally it does no harm at all to keep them all together when sharing them around - in particular the .prj is important to define the coordinate system of the shapefile, but you shouldn't need to explicitly be concerned with that). Its still in frequent use in many systems, and did become somewhat of a de-facto standard, but it's an old format and has certain limitations. In any case, a shapefile can contain a single 'layer' of data from a map. The Android SDK does not support loading and displaying shapefiles, so that's one obvious problem you have right there. Although we may add support for different data formats as we release new versions of the SDK, typically the SDK has been focused around displaying services - you can find out more about the sorts of things that are supported now here:https://developers.arcgis.com/android/guide/map-layer-types.htm#ESRI_SECTION1_56C39AB97812490786CC069DB09818EB Many years ago, his organization created a bike route map for his region. So here, your 'map' can refer to many different things. Esri's platform includes ArcGIS Online - this is the cloud part f the system, and stores maps as 'webmaps' - they only contain data from services, not local files. However, one useful thing is you can upload shapefiles to ArcGIS Online and then add them to a map. If your shapefile is not too big (not more than 1000 features) then using a completely free public account for ArcGIS Online, you could upload the shapefile - this will convert the features in the shapefile into features that get stored in the map online (it's stored as JSON). Then you can easily load this map using the WebMap class in the Android SDK, from where it resides online. A limitation would be that free accounts can only share data publicly - e.g. anyone could look at this data if they searched for it, although they would not be able to change anything, but they could save their own separate copy of it. Alternatives exist for paid subscriptions to ArcGIS, but that's probably getting a bit over complicated at this point for you. Also, all this assumes your device will be showing online data - it's not on the device itself. If the user however has a paid subscription for ArcGIS (which many esri users do have - if he pays maintenance for ArcGIS Desktop, then he should have as part of the desktop maintenance), then it's worth investigating what the paid subscriptions offer, possibly starting here: http://doc.arcgis.com/en/arcgis-online/reference/what-is-agol.htm). I just imported a shapefile and shared it in this map that I shared publicly: http://www.arcgis.com/home/webmap/viewer.html?webmap=c40369868c22454ebac5c2f241d50704 - you should be able to use this to test out what I described. Look at this sample for how to load a webmap - it actually includes a lot more code than you need but you can see the code that uses a webmap URL to create a MapView - https://developers.arcgis.com/android/sample-code/webmap-popup-viewing. Then if this works for you, you can make your own Esri account yourself, or have your user save the data to their own account. Other ways to work around the lack of shapefile support exist, especially if you have some flexibility with how your data can be exported, but using a webmap might be the easiest place to start. Hope this info helps some, do post back if you have other questions about it.
... View more
03-26-2014
05:21 AM
|
0
|
0
|
472
|
|
POST
|
sometimes, the callout is hidden while the map zooms and pans to the selected point and once the animation has stopped, the callout appears at the intended point.This is the expected behaviour. But occasionally the callout shows on the map as the animation starts and moves along the map as the map pans to the point. I have a little more information on the callout issue you mention. So as you note, the expected behaviour with the 10.2.2 release, when the map is animating, is that the callout is temporarily hidden, and when the animation completes, the callout will be drawn again, and should have automatically updated to the correct location. Which means the best way to arrange your methods is like your second code snippet, with the call to show the callout first, and then the call to zoom. It sounds like this expected behaviour is what you are seeing most of the time. However, the occasional problem of the callout showing on the map during animation sounds like a bug, but I've not been able to reproduce when using zoomToScale - can you figure out any particular situations where this happens, to help us repro and investigate this? Do you see this on all devices, or only certain ones, or only with certain types of animation/zoom?
... View more
03-18-2014
05:19 AM
|
0
|
0
|
892
|
|
POST
|
Hi Mike, I have not seen this issue specifically, but I can suggest a few things I would try. Make sure you're setting map extent or zooming in and out to the levels that you actually exported to the TPK. Also check you you did load the layer correctly - check the layer got initialized for example using MapView.getOnStatusChangedListener. Try loading an existing TPK file into your map with the same code - e.g. http://www.arcgis.com/home/item.html?id=4497b7bb42e543b691027840d1b9092a. Or try making an ArcGIS Compact Cache output instead of a TPK to see if that makes any difference. If yo have no luck I would post your generated TPK here so we could try loading it and see if we have same problems. Regards
... View more
03-18-2014
02:07 AM
|
0
|
0
|
618
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-03-2024 10:08 AM | |
| 1 | 01-02-2024 08:09 AM | |
| 1 | 11-07-2023 01:44 AM | |
| 1 | 08-03-2018 03:54 AM | |
| 1 | 03-07-2017 02:12 AM |