|
POST
|
Hi Joshua, You need to set the map view's layer delegate. Add this line to your viewDidLoad method: self.mapView.layerDelegate = self; Edit: Also, see Nimesh's answer below. That should get you into the mapViewDidLoad: method. Cheers, Nick.
... View more
03-06-2012
09:20 AM
|
0
|
0
|
542
|
|
POST
|
For 10.0, the toolset is arranged differently but attacks the same problems. I should also point out that at ArcGIS for Server v10, you can use the maxAllowableOffset property of an AGSFeatureLayer to generalize on-the-fly. This blog post covers the topic. Nick.
... View more
03-05-2012
06:11 AM
|
0
|
0
|
2030
|
|
POST
|
Hi Anoop, Good questions. Much of this is outside the scope of this thread and forum, but I'll try to give you some pointers. I didn't knew about generalization and our server version is 9.31. This is something we should implement on server side rite? Yes, server-side. And also how can we know if a layer is not generalized? Generalization is merely the process of reducing the "resolution" of your vector data to a level that suits your purposes (in this case, rendering at given zoom levels). For example, a polyline with thousands of points in it which is good for plotting a wall-sized map may only need one tenth the number of points to look exactly the same on a small screen. A better question might be: How do you know whether a feature class needs generalizing? Let's just consider viewing the data (editing is another issue, and the general rule is not to edit generalized data directly). And remember this discussion is for dynamic layers only (i.e. not tiled layers). [INDENT] Ex. 1: You could have a problem if you zoom in on a polyline or polygon layer much further than your app needs and can still see a lot of detail. That means that when you're zoomed at a working level, the data is too detailed for what you can see at that scale. Ex. 2: You could perhaps have a polygon that is the right level of detail, but that is much larger than your visible working area. The single polygon still needs to be pulled over in its entirety for rendering. Solving that can be a whole separate discussion. Ex. 3: You might find (as is possibly the case here) that the data is more detailed than your client specifications allow for, and so you'd want to create a generalized set of that data just for that client app. [/INDENT] There is a lot to consider. Client limitations, bandwidth, managing the data, data updates, editing. The 9.3 documentation has a short discussion on the topic and overview of the operations. You will need an ArcInfo license to use most of the tools (you'll probably need "Simplify Polygon"). For 10.0, the toolset is arranged differently but attacks the same problems. I do work with many complex layers with boundary of various states, municipalities etc. To be exact all the layers have some kind of complex irregular graphics in it 😞 If it were me, the first thing I would do is try to show that it is these complex layers that are causing your memory issue. Either use the profiler, or create a test set of generalized layers and use those. If so, try to categorize your feature classes: "Needs generalizing" (causes a memory warning), "could do with generalizing" (takes a while to load, but doesn't cause a memory warning), and "fine as it is". That should put you in a better position to work out your next steps (and longer term data management goals if necessary). Hope this helps a little, Nick.
... View more
03-02-2012
08:09 AM
|
0
|
0
|
2030
|
|
POST
|
Hi Anoop: I need a little more clarification, when multiple map layers are added the basemap is loaded first and the layers are redrawn from bottom to up manner rite? Yes. You add the bottom-most layer first and other layers are added on top in the order you add them using addMapLayer:withName:. See also the Layer Concepts Overview page for info about the Map's spatial reference. If there are any dynamic layers below a tiled layer, they will be masked if a tiled layer is fully loaded so we can safely hide these "masked layers" and save network traffic and memory. Not necessarily. A Tiled Layer may have transparency (see the World Transportation layer for an example). In this case, you would probably not want to hide layers added earlier in the sequence. As always, consider the data you're working with. Please do share if there are some memory management solution regarding this context. Here are a couple of thoughts: Add and Remove layers: You could consider using the AGSMapView's removeMapLayerWithName: and insertMapLayerWithName:atIndex: methods. Provided you are not somehow retaining a handle to the removed layer or layer view (you'd have to do it quite deliberately) that should help. Use the profiler to see. In my testing this helped reduce the footprint a little (although it may be no better than just hiding the layer as Nimesh suggested). Generalize complex lines/polygons: Note also that a Dynamic Layer will load the data as provided by the server and may cause a spike as it is loaded and rendered. If you find that you have very complex data, you could consider generalizing that data on the server end. In fact, if I add this layer (which is not generalized) and view the memory profile as it loads, it causes a spike in memory usage to well over 25Mb as the data is loaded before dropping down again once rendered. When testing against a generalized copy of the same dataset, the memory usage stays very low. Hopefully this will help a little. Cheers, Nick.
... View more
02-29-2012
05:59 PM
|
0
|
0
|
2030
|
|
POST
|
Hi Melinda, Might be a little cut-and-paste error in there. I think you mean something like: NSMutableDictionary *graphicAttributes = CurrentFeatureGraphic.attributes;
[graphicAttributes setObject:MarkupDescription.text forKey:@"Description"];
... Faisal: It's also worth noting that you probably shouldn't update the OBJECTID for an existing feature. This is auto-generated and shouldn't be updated (unless you've deliberately done something very odd to the feature class, and it's highly unlikely you'll encounter that). And for added decoupling from the attributes dictionary or geodatabase schema, you should consider using AGSFeatureLayer's objectIdForFeature: method when reading the Object ID. Nick.
... View more
02-29-2012
05:21 PM
|
0
|
0
|
1402
|
|
POST
|
Hi guys,i have next code, where answerText is UITextField if (answerText.text == @"1") { NSLog(@"YES"); } else NSLog(@"NO"); this code always returns NO when i type in textField "1" (in iOS Simulator),it returns YES only when i type in Xcode answerText.text = @"1",why? Hi. You're comparing pointers to two strings. Remember, @"1" is just a shortcut to create a brand new NSString object containing the single character '1'. Both strings *look* the same, but they are separate objects. Instead use isEqualToString: (see Apple's documentation). if ([answerText.text isEqualToString:@"1"]) { NSLog(@"YES"); } else NSLog(@"NO"); Cheers, Nick. UPDATE: I just happened across this road map from Apple, and this page seems particularly relevant.
... View more
02-29-2012
09:56 AM
|
0
|
0
|
801
|
|
POST
|
In addition to those steps, it is crucial to add this line of code when you create the feature layer, in order to get all the outfields available: self.myfeatureLayer.outFields = [NSArray arrayWithObject:@"*"]; Hi Mason, It's probably also worth noting that you should consider this in the context of the data you're pulling down and the requirements of your popup. While this is certainly the easiest way to make sure you have everything at your fingertips, for data sources with many fields and/or sources that might have fields with large amounts of data in them, consider only listing the fields you want to make use of (especially if running over 3G). Nick.
... View more
02-29-2012
09:34 AM
|
0
|
0
|
824
|
|
POST
|
.....make me want to post to this forum more:) And so you should, Adam (sorry I called you Aaron before!)! Glad you were able to work it out. Please do post here if you encounter problems with the SDK. We can't always promise to solve every problem, but we do the best we can 🙂 Nick. (BTW, if there's a checkmark on the post I provided above, perhaps you could mark this answered? It helps as I scan forum posts to see if I can help out.)
... View more
02-24-2012
01:38 PM
|
0
|
0
|
923
|
|
POST
|
Hi I trying to teach myself how to make mobile apps for the iOS, So i bought two classes from ESRI in December. Well that have not updated the class to match with the new 4.3 or the new OS Lion. The people at ESRI Training have been very unhelpful, I was hoping the forum could set me in the right direction. I did the class did like it said, but all i get is a white screen in the simulator (The web map did not load). I also tried using the soultion files but no luck. I have attached my project below. here is the software requirement for the class: ArcGIS API for iOS 2.0 Macintosh computer running Snow Leopard Xcode 4 iOS SDK 4.3 or higher Included with the Xcode 4 installation This is my software" ArcGIS API for iOS 2.1 Macintosh computer running Lion 10.7.3 Xcode 4.3 iOS SDK 5 I feel like this is some syntax error that not registering. please help1 Hi Aaron, I'm sorry to hear you're having trouble. I've built myself a VM with Mac OS X updated to 10.7.3 and Xcode 4.3 downloaded from the Apple App Store as well as the latest ArcGIS API (2.1). However, I'm unable to reproduce the problem. The solution you attached builds and runs fine and shows me the expected map display in the iPhone simulator. At least we know it's not a syntax error 🙂 Are you able to run the attached project and see a map of the world? Note: you may need to change the "Library Search Paths" project build setting. If not, could there be network problems/firewalls preventing you from accessing the data sources? Try opening this link from your developer machine. You should see a map of San Francisco 311 incidents. Cheers, Nick.
... View more
02-24-2012
03:51 AM
|
0
|
0
|
923
|
|
POST
|
Hi Patrick, Glad I could help. And thanks for marking it answered 🙂 Cheers, Nick.
... View more
02-22-2012
06:31 PM
|
0
|
0
|
1888
|
|
POST
|
Hi Patrick, If you deselect the "User Interaction Enabled" checkbox on your semi-transparent overlay UIView's Attribute Inspector, you should get interaction bubble through to the underlying AGSMapView. Note, there is a "User Interaction Enabled" setting under the Identity Inspector's Accessibility section too, but you shouldn't need to modify this unless perhaps you enabled accessibility in that same section. I've only tested this in the simulator so far, but can click, pan and pinch. Haven't tried any more complex gestures, but I suspect they'll be passed on through. Cheers, Nick. P.S. I've attached a minimal XCode 4.2/iOS 5 sample project to show this in action.
... View more
02-22-2012
02:29 PM
|
0
|
0
|
1888
|
|
POST
|
Hi, I think the problem is that your WebMap has as its basemap layer a Bing Maps layer, for which you need to specify your Bing Maps key. If you add this delegate method, and return your key, you should be good to go: -(NSString*)bingAppId{
return @"YOUR BING MAPS KEY";
} This page tells you how to go about getting a key. See also the sample delegate in the Concepts document. Hope this helps. Let us know how you get on. Cheers, Nick.
... View more
02-15-2012
09:00 AM
|
0
|
0
|
768
|
|
POST
|
- (UIView*) customViewForGraphic: (AGSGraphic *) graphic screenPoint: (CGPoint) screen mapPoint: (AGSPoint *) mapPoint{ NSMutableDictionary *graphicAttr = [graphic attributes]; GraphicDetailViewController *gdv = [[GraphicDetailViewController alloc] initWithAttr:graphicAttr]; gdv.tableView.frame = CGRectMake(screen.x, screen.y, 300, 200); gdv.tableView.delegate = gdv; return gdv.tableView; } There is at least one problem and possibly two with your code, depending on the implementation of GraphicDetailViewController. You are referencing the GDV as the delegate of the tableView object (so you will add a reference count). If the GraphicDataViewController's dealloc method releases the tableView object, then you will have a pointer to an object that was released when the GDV was released (this may be what's happening with your "deallocated instance" error). So, perhaps add a property to your class to store the current GraphicsDataViewController. You would set the property to the GraphicsDataViewController created in customViewForGraphic and release it when the callout showing the GraphicsDataViewController is closed. That way the delegate reference on the returned tableView remains valid for the lifetime of the tableView.
... View more
02-15-2012
06:45 AM
|
0
|
0
|
585
|
|
POST
|
OK, that's reassuring at least, because that's what I've always got and seems to be what Nimesh expected. n
... View more
08-18-2011
05:07 PM
|
0
|
0
|
408
|
|
POST
|
Hi all, Took a little bit of sleuthing and reading up of Apple's documentation, but I did in the end manage to get rid of those pesky "grid lines". They're doubtless tile boundaries that aren't being drawn to the graphics context in the same way as to the screen. To me it smacked of some rounding during rendering, or anti-aliasing. Sure enough, to get rid of them you need to add this line: CGContextSetShouldAntialias(UIGraphicsGetCurrentContext(), NO); However, you will notice if you're using a retina display, that the captured image is different to the on-screen one. To fix that, you need to begin the Image Context with some options other than the defaults adopted by UIGraphicsBeginImageContext(). This is some serious Apple silliness, but at least the documentation is there to guide you. So, use the following: UIGraphicsBeginImageContextWithOptions(self.mapView.frame.size, NO, 0.0f); By specifying a scale of 0.0f, you are telling the renderer to use the device's main display's resolution. On a retina display, you'd get the same effect if you used 2.0f, but 0.0f will work on any device. You might also get away with YES instead of NO for the opaque parameter if you know enough about the layers you're rendering etc. etc.. So, the final code looks something like this: UIGraphicsBeginImageContextWithOptions(self.mapView.frame.size, NO, 0.0f);
CGContextSetShouldAntialias(UIGraphicsGetCurrentContext(), NO);
[self.mapView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//save image to photo album
UIImageWriteToSavedPhotosAlbum(screenshot,self,@selector(image:didFinishSavingWithError:contextInfo:),nil); Hope this helps! By the way, I still haven't got this to work in the simulator. Rick - do you remember how you got that to work? Nick.
... View more
08-18-2011
12:25 AM
|
0
|
0
|
1405
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-05-2025 10:52 AM | |
| 1 | 11-04-2025 08:55 AM | |
| 1 | 11-04-2025 08:38 AM | |
| 1 | 11-01-2025 03:25 PM | |
| 1 | 10-29-2025 10:28 AM |