I'm hoping for a straightforward way to display up to 200 points in a Map at once without degrading performance when the user is zoomed out and all of them are on the screen.
We have a draw order of priority and the most important ones are above the others. How can I hide the ones underneath until the user zooms into a specific area?
you can use these delegate methods to determine which region and the zoom level is being shown and show the points accordingly...
– mapView:regionWillChangeAnimated:
– mapView:regionDidChangeAnimated:
refer apple docs for more info..
Related
I'm using the UIImagePickerController to control the camera and overlay millimeter tick marks in preview for measuring closeup macro shots, and I'd like to be able to detect the current zoom level and scale it properly.
Is there any way to determine the current zoom level in camera preview?
Unfortunately no, since the UIImagePickerController API doesn't give you access to the camera zoom level, nor to any subviews or other properties that might have access to that information.
As Michael Dautermann points out, based on the answer to this question, you could use the cameraViewTransform property of UIImagePickerController to implement your own zoom by setting up the right CGAffineTransform and also the right pinch gesture to zoom in/out. Since you'd be controlling the zoom yourself, you'd always know the zoom level and be able to use it to adjust the tick marks.
CorePlot: Candle Stick ,
how to set more distance between every stick when zoom in and zoom out?
When i try to zoom out, it looks really terrible.
How can i fix it?
You have several options:
Make the bars narrower using the barWidth property.
Filter your data to show fewer bars. Call -reloadData on the plot to load the filtered data.
Make the whole graph wider (probably not an option on iPhone, but may be practical in an iPad or Mac app).
I am interested in adding an option to my GIS Map application, the ability to draw Polygon, circle, polyroutes overlays for the user to search data within.The problem is that I've read and tested codes of how to draw an overlay, but they are always static.I want it to be dynamic, with dynamic center and points (or radius) set by the user on click.A mystery for me.(I'm a beginner in iPhone programming, this is my first app.)And I'm not using and don't want to use things like ArcGIS API for iPhone.I would appreciate any help.
To let the user "draw" an arbitrary polygon on the map, one approach is to use draggable annotations that represent the corners of the polygon. Provide an "Add Corner" button and some kind of Remove Corner button on each annotation.
See my answer to User creating a box on MKMapView for some more details. On that question though, the OP actually ended up using another solution described in the comments which would work well if the polygons are always rectangles.
For implementing a button in an annotation view (if you want a "Remove Corner" button on the annotations), see my answer to How to get click event from a button added over MKAnnotationView.
Once you a have a polygon or other overlay on the map, dragging it by direct touches may only be possible by adding a gesture recognizer to the map (with its own scrolling turned off) and using a custom MKOverlay and MKOverlayView that allow coordinate changes. Adding a gesture recognizer directly to an MKOverlayView doesn't seem to work and the built-in overlay classes don't allow changes to coordinates.
An alternative to moving by direct touches is putting some controls on the side (Up/Down/Left/Right/etc buttons) that modify the custom overlay.
The Apple sample app Breadcrumb gives an example of a custom overlay/view for a path. In WWDC 2010, the sample app LocationReminders gives an example of a custom overlay/view for a circle that can move and resize.
Finally, when you do a search for businesses, you could use the overlay's boundingMapRect (which is always a rectangle regardless of the overlay's shape) as the bounding box for the initial search and then check if the coordinate of each business found is in the overlay's actual shape using the answer to How to determine if an annotation is inside of MKPolygonView (iOS).
I am working on an app in which I want similar kind of functionality as that of WebMD body image.
How can I identify which part of image is touched in an optimal way? Do I have to slice the image according to requirements?
How can I add some tags into the image? Similar to the facebook photo upload functionality in iphone.
You need some way to figure out what the user touched, or tried to touch.
You might use a list of annotation-like objects, where each object has a location. When the user touches the image, you'll need to find the annotation in the list that's closest to the touch location and react appropriately. The "optimal" way to do that is probably to use a quad tree. For an iPhone app, though, the number of touchable points is probably pretty small (several dozen?), and a brute force search through the list will probably be more than fast enough.
Another option would be to overlay a transparent view on top of your image for each region that you want the user to be able to touch. Doing this would also make it simple to draw a "tag" at each of those locations.
I am new to MKMapView. I implemented a mapView which is looking good. But i was planning to add points or custom image as point in MapView. I can implement it with the help of MKAnnotation, but when i read MKOverlay it was mentioned that Overlays are also annotations. So whats the difference between these two??
Thanks in advance,
aby
In a nutshell, MKAnnotation is based on a point (x,y). MKOverlay is based on an area, bounded by a rectangle.
An MKAnnotation is simply a point on the map, often represented with a red pin icon (you'll see these if you search for a location in Apple's Maps app on iOS), whereas an MKOverlay is another layer over the map to display extra information. A good example of this could be the traffic overlay displayed on the map in US regions to indicate the current level of traffic.
You'd want to use an MKAnnotation in situations where you need to show the user a specific point on a map, but if you want to display more information to them over a larger area, go with an MKOverlay.
Apple uses an MKOverlay to display shipping routes for boats in their WWDC video on the topic (Session 127 – Customizing Maps with Overlays). That would be a good place to learn the full difference between the two, and how to use overlays correctly.