POST
|
This has happened to me once but I couldn't reproduce it. I fixed it by uninstalling from wherever it got installed and running the installer package again. Then it was in the ~/Library... location. I can't quite recall but I may also have rebooted between uninstalling and reinstalling. I'm not happy with this answer, but it might get you going again until the real answer appears 🙂 Let me know whether it works? Cheers, Nick P.S. Caveat: I'm not on the iOS team - they might have a better idea of the problem. EDIT: Ah yes. Now I see your response below, I recall that I had to manually delete the /Library/SDKs directory (not ~/Library/SDKs, mind you!) and the /Library/Application Support/AGSiOSRuntimeSDK directory because, as Divesh mentions, the uninstall script doesn't touch those 🙂 Once I'd deleted those (and made sure I didn't have one under ~/Library), I just tried again and it worked. However, I'm not so confident that'll work for you given your other replies. Nick.
... View more
01-10-2013
07:34 PM
|
0
|
0
|
659
|
POST
|
You cannot just cast an AGSEnvelope to AGSMutableEnvelope (see here). Try something like this:
AGSMutableEnvelope * env2 = nil;
if([featureSet.features count]>0)
{
for (int i=0 ; i<[featureSet.features count]; i++ )
{
graphic=[featureSet.features objectAtIndex:i];
if (env2 == nil)
{
// graphic.geometry.envelope is an AGSEnvelope
// We need to derive a new AGSMutableEnvelope from it.
env2=[graphic.geometry.envelope mutableCopy];
}
else
{
// This is not the first graphic we've come across, so we'll
// extend the working envelope (env2) to include it
[env2 unionWithEnvelope:graphic.geometry.envelope];
}
// Add the graphic to our graphics layer
graphic.symbol=fillSymbol;
[self.graphicsProjectQryLayer addGraphic:graphic];
}
// env2 will now contain all the graphics we just looped over.
// Refresh the graphics layer
[self.graphicsProjectQryLayer dataChanged];
}
This is typical with Cocoa development and Mutable versions of classes. You can generally cast a Mutable object to its non-mutable form (typically it's parent class, so an NSMutableArray is a NSArray), but the other way around requires a new object of some sort.
... View more
12-31-2012
08:05 AM
|
0
|
0
|
193
|
POST
|
Afraid not, so I wrote you one 🙂 For simplicity, I load up a few WebMaps ahead of time (you might want to do this on-the-fly in your app). I'll use these as basemap options. I'll also load up one WebMap with actual content. When the user picks a different basemap, I reference the content WebMap and the appropriate basemap WebMap. The only additional trick is to store and set the extent "around" the basemap change, otherwise each basemap change returns the map view to the content WebMap's default (saved) extent. I also don't initially set the basemap, but just rely on the "Content" basemap. You'd want to take care of that in a real app. Hope this helps, Nick.
... View more
07-11-2012
04:39 PM
|
0
|
0
|
348
|
POST
|
Hi John, Have you looked at AGSWebMap::openIntoMapView:withAlternateBaseMap: and AGSWebMap::openIntoMapView:withAlternateBaseMap:resetMapView:? If you have an AGSWebMap whose basemap layers you want to use, use the AGSWebMap::baseMap property to get an AGSWebMapBaseMap object, and pass that in to one of the above function on the AGSWebMap whose basemap you want to update. Note, you could just use the stock basemaps (although Bing and OSM may be special cases) rather than creating your own. Hope this helps, though I'm not 100% sure I understood your question. Nick.
... View more
07-11-2012
09:04 AM
|
0
|
0
|
348
|
POST
|
Hey Rob, I *think* I see what you're saying now, but if so I don't see what could be going wrong so it may be time to look at some code. Could you attach a project here for me to look at, PM me or send me an email (use my forum ID at esri.com)? Cheers, Nick.
... View more
03-16-2012
10:30 AM
|
0
|
0
|
886
|
POST
|
Hi Anoop, In short, since everything used by the web and mobile SDKs is being projected onto a flat (2D) surface, it will need to have a spatial reference (essentially a set of rules describing that projection). Many web/mobile maps use spatial reference 102100 (Web Mercator Auxiliary Sphere). This is good for display. It's what consumers have come to expect (hence why many of our basemaps use that spatial reference). But it's probably not best way to store geodata in most parts of the world, so you may encounter various spatial references across the data you use. In the documentation you quote, the gist is this: The first layer you add to the map will define the map's spatial reference. Once the map's spatial reference is set, all data will display in that spatial reference. Because Tiled Layers are cached in a predefined spatial reference, they cannot be re-projected on the fly (re-projecting takes effort, so it would defeat the purpose of caching them!). That is why the spatial reference of tiled layers must match the spatial reference of the map. Because Dynamic Layers are not cached, they may be projected on-the-fly. So while they must have a spatial reference describing the stored data, they can be re-projected to the map's spatial reference on request. Again, this can take effort on the server or client, so it's a balancing act, but in practice in most cases you'll be OK. See also here and here to learn more about Tiled and Dynamic layers. As for your example, the service is a GlobeServer service. You cannot use this with the mobile or web SDKs. Instead, here is the 2D equivalent. Note the type is Feature Layer. Because it's for use in 2D, it has a spatial reference. [Note also, it's in extended support and you should really use this.] Hope this clears things up a little. Cheers, Nick.
... View more
03-16-2012
05:23 AM
|
0
|
0
|
271
|
POST
|
Hi Robert, I'm not entirely sure I understand what you're asking, so please set me straight if I've got it wrong, but I think you want to have a UIView displayed above the AGSMapView and you want it active (i.e. the user can interact with it) only some of the time? Take a look at this post. You could set the userInteractionEnabled property of the UIView displayed above the map to control whether it traps UI events or not. Set it to NO and the events pass right on through to the map. Again, apologies if I've misunderstood. Let me know. Cheers, Nick.
... View more
03-16-2012
03:48 AM
|
0
|
0
|
886
|
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
|
226
|
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
|
896
|
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
|
896
|
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
|
896
|
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
|
582
|
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
|
356
|
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
|
374
|
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
|
445
|
Title | Kudos | Posted |
---|---|---|
1 | 2 weeks ago | |
1 | 01-08-2024 09:34 AM | |
1 | 11-17-2023 12:38 PM | |
3 | 11-17-2023 09:56 AM | |
1 | 10-24-2023 02:47 PM |