POST
|
You could create a custom tiled layer which contains an instance of the runtime's layers, and cache tiles as they're returned by the contained instance, before you pass them back to the AGSMapView. This repository does a similar thing, but it applies a Core Image Filter to each tile before passing it on rather than caching it. However, you would need to carefully consider how to handle cache cleanup and constraint. What do you eject from the cache when memory constraints start getting hit: Least used? Oldest in cache? Furthest from current extent? Furthest from current zoom? Do you eject groups of tiles at once, or individual tiles - you probably want to consider contiguous areas. Doubtless the best solution would be some combination of all of those. Note: Even if you came up with a good caching strategy, to do this against one of the Esri provided basemap layers would, unfortunately, currently be against the licensing terms.
... View more
01-17-2015
10:51 AM
|
0
|
0
|
330
|
POST
|
Your GP Service only has the Execute endpoint, so you should use the synchronous call: [self.geoprocessor executeWithParameters:params]; However, that still doesn't work for me, but I'm not convinced that I know how to get your GP Service to work. I'm unable to run it from the web interface. If using the above call doesn't work, can you give me some parameters that do work properly from the web interface here: Execute Task (Script) Cheers, Nick.
... View more
11-17-2014
01:12 PM
|
0
|
0
|
490
|
POST
|
I think your instance of AGSGeoprocessor is going out of scope and so is being deallocated before the GP Tool finishes. Try creating a class-level property instead: @property (nonatomic, strong) AGSGeoprocessor *geoprocessor; And change the code to reference that property instead: // Build geoprocessor self.geoprocessor = [AGSGeoprocessor geoprocessorWithURL:gpURL]; self.geoprocessor.delegate = self; ... //Run GP tool with asych delay self.geoprocessor.interval = 10; [self.geoprocessor submitJobWithParameters:params]; } Hopefully that'll get you rolling. Nick
... View more
11-13-2014
09:38 AM
|
1
|
2
|
490
|
BLOG
|
I think it was some dude name Grohn Javois. Have you met him?
... View more
10-08-2014
04:32 PM
|
2
|
0
|
377
|
BLOG
|
I write a lot of demos. When you travel somewhere, show a local map. It helps folks relate, and they're less likely to heckle you. Since we have interactive maps, the best way to get a local map is to search or just pan-and-zoom. But once you've navigated your map to the right place, how do you get hold of the settings to open your demo at the right place? The short answer is JavaScript. The ArcGIS Online map viewer is JavaScript-based. This means that pretty much everything is exposed through the browser's developer tools. You just have to figure out how to get to it. In Chrome, for example, open a map (try a blank one, or find an existing one), and from that browser window click the hamburger icon at the top-right and select "More Tools -> JavaScript Console". The window that opens is the JavaScript view onto the ArcGIS Online page. So just start typing JavaScript to explore! ArcGIS Online exposes a couple of convenient global variables you can access. Type arcgisonline.map.main.map and press ENTER (notice the auto-complete that helps you explore?). What you see is the actual Esri JavaScript API Map object behind the ArcGIS Online map viewer. JavaScript FTW! Here are some examples. For cut-and-pastability, here they are again. Try them out, and follow along at the JavaScript API Reference for the Map class: arcgisonline.map.main.map.getZoom() arcgisonline.map.main.map.getScale() arcgisonline.map.main.map.extent arcgisonline.map.main.map.extent.getCenter() arcgisonline.map.main.map.extent.getCenter().x arcgisonline.map.main.map.extent.getCenter().y arcgisonline.map.main.map.extent.getCenter().getLatitude() arcgisonline.map.main.map.extent.getCenter().getLongitude() All this information can be used to fine-tune your demo, whether it's JavaScript based, Runtime based, or whatever. Bookmarklets That's a lot of opening developer tools and typing at consoles. What if you could just package up the JavaScript you want and keep it handy somewhere. Well, you can, and it's called Bookmarklets. A Bookmarklet is simply a bookmark that, rather than opening a web page, instead just runs some JavaScript on the page you're currently viewing. I've created a Bookmarklet that inspects your current ArcGIS Online map view and shows you some details. You can find it here. Just drag the Bookmarklet named "Get Map Info" to your bookmarks bar. Now, whenever you're viewing a map in ArcGIS Online's Map Viewer, just click that bookmark and you get an alert containing info about the map. Neat! For some more info about bookmarklets, see the quick talk from Cascadia JS below, and check this great tool for packaging your JavaScript up as a bookmarklet-friendly JavaScript. For initializing a map, there's also this tool which will give you a code preview for your demos.
... View more
10-08-2014
04:15 PM
|
3
|
5
|
2607
|
POST
|
So far, it seems to be working... The key was to add ArcGIS.h to the "Objective-C Bridging Header" setting under Swift Compiler - Code Generation of Build Settings. Throwing this out there too... In the case where you have a Swift-only project, you can also do the trick described in this Gist. You'll need an import ArcGIS statement in the .swift file too. E.g. import UIKit import ArcGIS var tileUrl = "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" class ViewController: UIViewController { @IBOutlet var mapView : AGSMapView override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. var myLayer = AGSTiledMapServiceLayer(URL: NSURL(string: tileUrl)) mapView.addMapLayer(myLayer) } } Enjoy! Nick. P.S. I guess I should add that (as mentioned in the Gist) this isn't supported by Esri yet. Use at your own risk 🙂
... View more
06-09-2014
10:00 AM
|
0
|
0
|
676
|
POST
|
Hey James. Apologies for the previous answer. I skim read your question and missed that you were using the Spatial Analysis Service 😮 I haven't actually used the Geoprocessor task with the Analysis GP Service at analysis.arcgis.com. It seems to be a wrapper around the Network Analyst task found at route.arcgis.com to allow the request to be queued in the GP Tasks queue that's part of AGOL Analysis (and seems to parameterize some things that get built into lower-level parameters to the underlying NA service). You will need to populate the "serviceToken" property on "analysisLayer". Also, it should probably be "nearLayer" and not "NearLayer". Failing that, the approach I've taken in the past is to hit the Closest Facility Task directly at http://route.arcgis.com/arcgis/rest/services/World/ClosestFacility/NAServer/ClosestFacility_World/ In that case, your analysis layer URL needs to be a full query, not just the service end point and to include a token if the service is private. For example, this works in the sample I posted up at https://github.com/nixta/PhillyParksDemo: http://services.arcgis.com/OfH668nDRN7tbJh0/arcgis/rest/services/Markets%20close%20to%20parks/FeatureServer/0/query?where=1%3D1&returnGeometry=true&outFields=OBJECTID&outSR=102100&f=json
See also the documentation here under the "facilities" required parameter - there's an example URL right at the end: {
"url": "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/MapServer/1/query?where=1%3D1&outFields=Name,RouteName&f=json"
} Hope this helps. And sorry again! Nick.
... View more
03-04-2014
02:20 PM
|
0
|
0
|
1544
|
POST
|
Hey Darryl, I created one just after UC but need to push it live on Github. Let me revisit and I'll get back to you. Nick
... View more
10-23-2013
12:44 PM
|
0
|
2
|
476
|
POST
|
Hi Guido, One thing to note is that the layer service in question doesn't have "support statistics" enabled. See the first Note on the outStatistics section of the doco and see the service definition here. Secondly, in your web interface example above, you are not encapsulating your outStatistics value as an array. You should wrap it in []: [{
"statisticType": "count",
"onStatisticField": "Status",
"outStatisticFieldName": "StatusCount"
}] Perhaps you can get Brandon to enable statistics on the service and then you should be good to go. Let me know if that helps. However, I feel the error message could be a lot better and I'll see if I can log an issue with the right team. Nick.
... View more
09-28-2013
09:43 AM
|
0
|
0
|
387
|
POST
|
The original problem is that the tiled map service layers in the iOS api are displayed with fuzzy, low resolution. Compare to android, which displays tiled layers correctly. The tile imagery looks as expected to me. In the original post, it's only the symbols overlaid on the map which are fuzzy and that has been fixed. In the case of tiles, the global ArcGIS Online tiles have not been generated to retina display dpi. For that reason, the SDKs will render them at the generated tile resolution by default. You can opt to render the tiles at native display resolution by making use of AGSTiledLayer's renderNativeResolution property (which I think is what the Android app does), but it can make label text very small (see screenshots). It essentially gets the next zoom level of tiles and renders them smaller. Tile Resolution: [ATTACH=CONFIG]27608[/ATTACH] Native Resolution: [ATTACH=CONFIG]27609[/ATTACH] Also attached is a project that allows you to switch between native and non-native resolutions to see the difference. Hope this helps, Nick.
... View more
09-19-2013
01:46 PM
|
0
|
0
|
261
|
POST
|
This link had me struggling for many hours (please avoid): https://developers.geoloqi.com/ios/maps Hi Carol. I'm intrigued to learn what you struggled with in that blog post. It seems to reflect exactly how we describe setting up projects in the main tutorial you reference elsewhere (and how I set up all my samples). I've not had any difficulty including AGSMapView in a view hierarchy, including as part of a Tab View Controller, so I'd be happy to look into it further with you since we're always keen to know if we can improve documentation. Please let me know. Cheers! Nick.
... View more
09-14-2013
09:15 AM
|
0
|
0
|
304
|
POST
|
Hi Hussein. Note that in your screenshot the drop-pin symbology is not blurry, it's just the map tiles. This is because the Geocode sample is using a basemap tile service (http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer) which is no longer updated and which doesn't have global coverage for all zoom levels. If you were to zoom in to that level in the US, you would not see the blurring. Really the sample (and you) should be using http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer. That tile service is the same as used by the basemap picker at ArcGIS Online and by the ArcGIS iOS App. Incidentally, in your screenshot of the app, it's using the Topographic Basemap, not the Streets Basemap. It's a multi-step process to look at an ArcGIS Online basemap and work out the URL to use, so I have created this reference page which may help: https://github.com/nixta/arcgis/wiki/Basemap-URLs Please let me know whether this resolves your issue. Nick. P.S. I have asked that the sample be updated to use the current tile sets.
... View more
09-13-2013
04:24 PM
|
0
|
0
|
1445
|
POST
|
Could be. Depends on what the projection is of your map. I'm guessing it's not Web Mercator 😄 My solution will generate you a polygon that is pretty close to circular on the ground (i.e the edge is R miles north and R miles east of the center). If you are using a Web Mercator projection, it will appear circular on the map. If you are using WGS84 for example, it will indeed appear less tall as you move north or south from the equator, by virtue of the projection. If you want something that looks circular on a WGS84 map, and you know that your center point is WGS84, you can either use your & Technobrat's solution or something like this:
-(AGSPolygon*) circleWithCenter:(AGSPoint*)point radius:(double)radiusInMiles
{
AGSGeometryEngine *ge = [AGSGeometryEngine defaultGeometryEngine];
// Get a "circle" around the point, using the 1 decimal degree ~= 69 miles.
AGSPolygon *circle = [ge bufferGeometry:point byDistance:radiusInMiles/69];
return circle;
} But remember that this is approximating the conversion between decimal degrees and meters, which is not constant for longitude as latitude varies. So, it really depends on what you are generating the 10 mile radius geometry for and (in short) how far north or south of the equator. Your solution may be good enough for what you want, but bear in mind that a degree of longitude will be very much less than 69 miles as you approach the poles. On the other hand, your application users may keep asking you why the "circle" is elliptical, and that might be a bigger headache than considering some things that might be more than 10 miles away.
... View more
08-06-2013
01:33 PM
|
0
|
0
|
1763
|
POST
|
The units will be decimal degrees. What you might find useful is to buffer around your center-point. Try something like this:
-(AGSPolygon*) circleWithCenter:(AGSPoint*)point radius:(double)radiusInMiles
{
AGSGeometryEngine *ge = [AGSGeometryEngine defaultGeometryEngine];
// Get a point in a spatial reference whose unit is Meters.
AGSPoint *pointToBufferAround = (AGSPoint *)[ge projectGeometry:point toSpatialReference:[AGSSpatialReference webMercatorSpatialReference]];
// Get a "circle" around it, using the unit Meters (1 mile ~= 1609.344 meters).
AGSPolygon *circle = [ge bufferGeometry:pointToBufferAround byDistance:radiusInMiles*1609.344];
// Project the output back to the projection of the input point (which is presumably what you're after).
circle = (AGSPolygon *)[ge projectGeometry:circle toSpatialReference:point.spatialReference];
return circle;
}
That will use Meters (WebMercator's units). Note that your output may not be what you expect as the input or output approaches the poles. Also, there's no guarantee how many points the output polygon will have in its boundary.
... View more
08-06-2013
12:21 PM
|
0
|
0
|
1763
|
POST
|
It's quite tricky to positioning the element on the User interface without adding them to the MapView-element. I succeed only positioning the element by the attributes. As I am new to all of this, i hope this helps you too. 😄 Hey Tom. Yep, this is pretty annoying Xcode behavior for me too. I've found the following have really helped me: Drop new UI components into the hierarchy on the left rather than directly into the WYSIWYG editor. Use the cursor keys to move the element. Hold SHIFT while using the cursor keys to move the component quicker. Hold OPTION while using the cursor keys to show position attributes. You can drag to resize a UI component without changing its position in the hierarchy (but drag to move will). COMMAND-Z is your best friend if you drop a control in the wrong spot 😄 Hope that helps too. Cheers, Nick.
... View more
06-03-2013
08:35 AM
|
0
|
0
|
563
|
Title | Kudos | Posted |
---|---|---|
1 | 10-03-2024 04:31 PM | |
2 | 10-03-2024 03:16 PM | |
1 | 10-02-2024 04:25 PM | |
1 | 09-24-2024 08:52 AM | |
1 | 09-16-2024 10:25 AM |