Graph should not be move if not zoomed - ios

I am using core plot to draw graph. Graph moves always whether it is zoomed or not. But I want like it should not move until it is zoomed. In zooming state we should allow panning(moving left/right) to see the whole graph.Any help would be appreciated.

I can think of several ways to do this:
Disable user interaction when zoomed out. Enable it when the user zooms in.
Set the globalXRange and globalYRange on the plot space. The plot won't scroll outside these ranges no matter how far out you zoom.
Use a plot space delegate. Implement the -plotSpace:willChangePlotRangeTo:forCoordinate: delegate method. If the proposed range is outside the desired scrolling range, modify the range to your preferred range before returning it.

Related

Increase tap area of GMSPolyline

,In our app, users can create GMS- features on a map. Those features are then editable, with the editing process starting from a tap. In some cases, if the style applied to a polyline is a 1 or 2 point line, they are difficult for a user to tap. I have researched this and found nothing on how to increase the tap area.
I would like to do something like adding a buffer around the line, such as in this example, but the buffer would not be visible to the user as it would only provide an increased tap area:
Does anyone know if this is possible? Any good resource on how to do this? Thanks!
If you want to know if the user tapped a location that is within a certain distance from a GMSPath you can use GMSGeometryIsLocationOnPathTolerance .
Using this combined with the mapView:didTapAtCoordinate GMSMapViewDelegate method you're all set.

Drag and Drop plots and other available features of Core-Plot?

i am new to core-plot frame work, i have few doubts about the feature of this frame work. May be my question very simple or unwanted, but still i am posting here for my clarification.
Its possible to drag and drop plot in core-plot framework.
Can i achieve smooth scrolling (like: UIScrollView) in core-plot?
If my graph size is beyond screen size means, how i can handle to scroll the graph to see fully?
If Its possible means kindly guide me to which Class or API provide this features, or any other things i have to follow. Thank you in advance....
Short answer, yes.
Set the allowsUserInteraction to YES for each plot space you want to respond to touch scrolling and pinch zoom events. Set allowPinchScaling to NO on the hosting view to keep the scrolling behavior and disable pinch gestures.
The xRange and yRange of the plot space determine the visible are of the plot area. Any plot data outside these ranges will be clipped and invisible. The plot ranges can be changed by the user (via scrolling and/or zooming) or directly in code by the app.
Be sure to look at the example apps included with Core Plot. Many of them include scrolling graphs.

Drawing World Map - Performance & Interaction - iOS

I’d like to use a Shapefile to generate an interactive world map. I was able to import the data and use CG Paths to draw the map into one large view.
The map needs to support panning, zooming and touch interaction. For that, I've created a UIScrollView and placed the MapView (large view with all of the countries drawn) into it.
I need to improve two aspects of it:
Performance / rendering
I have drawn the map much larger than the screen size, in order to make it look reasonable when I zoom in. There are a few problems with this. First, when I'm zoomed out, I need the border stroke/line to be wider so they are visible. When I zoom in, I'd like the stroke to be a thinner. Also, when I zoom in, I can still see that the map is a blurry. I don't want to increase the view size too much.
How can I make the map look crisp when I'm zoomed in? I attempted to redraw the map on zoom in, but it takes far too long. Can I somehow only re render onscreen stuff?
Touch Interaction
I need to be able to have a touch event for every different country.
Possible approach?
I was thinking of trying to separate every country onto it’s own view. That should make touches easy to handle. Then I’m thinking I can possibly redraw the appropriate views that are on screen/zoomed to.
I've played with an app that does something similar ("World Maps"), and I can see that when you pan or zoom, the map is blurry for a second but then becomes clear. What is going on there?
use mapkit and provide custom tiles. dont reinvent the wheel and try to write yet another map framework
I think that you have to create different scaled area image from the big map image. how to say... imagine the google map, how it works... I think that provide many different zoom factor image for every area of the world... then merged display on the screen while user need show it ...
use code implemented the map effect is impossible on current iPhone device, out of the ability of the iOS device

ios sdk MKMapView overlapping pins?

I have map view and many pins on it.
When the map view is zoomed out, I group overlapping pins into 1 (and show in label total count of pins in it).
But what to do, if map view is max zoomed in, and pins are still overlapped?
How can I shift them while they do not overlap each other ?
Something like this:
Or is there another solution?
In a slightly different solution to the same problem, the demo in the WWDC 2011 #111 - Visualizing Information Geographically with MapKit video (the demo is a little more than 18 min into the video) illustrates an example of how you can prevent overlapping annotations (including some nice animation revealing and hiding more detailed annotations as you zoom in and out).
What they do is to break the mapview into a grid of a particular size (I think they use 60px), and if they are too close, they pick one for that grid and hide the others. They also do a graceful hiding of the annotations as you zoom out (so you can see the annotations that are being hidden fly into the visible annotation for that group). As you zoom in the annotations are unhidden, you see it fly out of the one central annotation for that grid.

Is there any way to programatically zoom MKMapView without it snapping to one of its predefined zoom levels?

I am using setRegion to have MKMapView zoom in to the region I have supplied. The problem is that there is very little granularity to this and it simply chooses the most proximate zoom-level and zooms to that.
Is there any way of having it zoom to exactly the region I have supplied or do I need to accept this limitation and move on?
No, currently it zooms so that the map tiles aren't blurry, which means fixed zoom levels. The upcoming update seems to render on the fly, so you may be able to do it in the future, but for now you'll have to accept the region you get.

Resources