I'm struggling to get all of my entries showing in my chart. Here's what it looks like
PinchZoom is enabled, but I can't zoom out anymore.
Is there some way to programmatically zoom out more, or to set the bounds of the view?
Check the documentation of the YAxis.
There are a lot of ways to extend the range of the axis. However I am pretty sure something is wrong with your setup.
Related
I have lots of custom annotations and polylines on map, and it becomes a huge mess when i zoom out. Is there any way to hide them? I'm not familiar with MapKit, so only solution that i figured out is to create event on changing zoom level and re-add annotations whose zoom limit(it will be custom annotation property) is higher or equal to the current, but i'm afraid that it will be slow. Is there any other way?
I think, you should group your points in map. When you zoom in make ungroup, zoom out - group.
resources:
http://five.agency/having-fun-with-ios-map-kit-grouping-annotations/
https://github.com/choefele/CCHMapClusterController
https://github.com/yinkou/OCMapView
What I'm trying to do now is a table, with 2 labels on a row, and different background color for each label. I stumbled upon something very unexpected.
This is what I want to achieve:
But once I do the same thing inside a tableRowController I get this:
The proprieties of the objects are the same, and yet, the groups inside the table do not extend to the whole view. It's like they hit an invisible wall or something.
Does anyone else has the same issue?
Is there a fix/workaround for this?
P.S. I messed around with all the proprieties in attribute inspector I could, was not able to get to the desired outcome.
On the top-level group, set "Insets" to "Custom", with 0 values for all of them. You'll probably need to add back insets on the lower-level groups.
i want my app to be able to track a person when he moves 2 dimensionally upwards. I already have a vertical scroll view, and it works, but when i press a button i want it to track a little stick figure as he walks vertically, how can i control this? i thought of setting the scrollview.contentoffset to a certain position, but it just changes it one time when i want it to change it fluidly. i suppose i could make a timer that updates the contentOffSet every like .001 seconds or something, but i thought there maybe a better way.
Also, while i was searching the UIScrollView's methods, one of them was an isTracking method, which is a boolean, and I'm assuming it returns yes if the scrollview is tracking something, so given that i assume there is a feature in scrollview so that you can track things. Also, if to track things you have to use some other framework thing that would be helpful to know too
THANKYOU FOR ANY HELP!
The property tracking tells if the scroll view is currently tracking the user's movement. So that definitely won't help you out. (See David H's post for a better explanation for what the property indicates.)
However, you could use setContentOffset:animated: and set animated to YES. That results in a smooth transition to the new content offset.
Instead of calculating a reasonable content offset you might find it easier to specify an area that contains the stick figure. If so use scrollRectToVisible:animated:. Obviously animated should be set to YES.
1) don't use contentOffset = x;, use "- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated". Experiment how often you need to send this message, but I'm guessing you can do it no more than 10 times a second and get nice results.
2) isTracking means the user has their finger on the scrollView but has not started dragging it. By testing "isTracking" and "isDragging" you can determine if the user is fiddling with your scrollView or not.
I've started to use the Mapping Toolbox in MATLAB for a project of mine, and below is a screenshot of what I currently have created using it.
What I'm trying to do now is remove the white box from behind the actual map, but I can't seem to figure out how to do it. I've trying setting 'Frame' to 'off' with the axesm command when first creating the map, but that doesn't do it. I've looked through the documentation to try to figure out why there's even a white background (and when I use the worldmap command the box doesn't appear), but I cannot determine why.
EDIT: I am looking to remove the white background entirely, so as to have the main contour plot surrounded by the figure's background color, which in this case is the gray.
The background color of a figure is a property of that figure named 'color'.
If you set that property to the value 'none' then you will have no background.
So, the easiest way to do it is:
set(gca,'color','none')
Of course you can give a figure handle instead of the current axes (gca).
The more aggressive option is to set the entire axis off:
axis off
But this will remove the axis completely, including labels and such which might not be what you want.
Try axis off when it's in focus, axis(handle,'off') when not
I have a potential solution.
If you run
get(figure(1))
to find the figure attributes and run
set('some resize property',[some set of values])
or
setm('some resize property',[some set of values])
You may be able to 'fill in' the space this way, unless there is an easier property to change. Can you please give more details if this does not lead to a solution?
Hope this helps!
I'm working on Map application that needs to work like original MapView on iOS.
I need to rotate mapview according to compass heading value. I tried MTLocation example also I also tried this answer But my results is not good.
Please see the screen shot.
When I rotate mapview according to heading value Map is rotating but as you can see on screen tiles is missing.
How can I solve this display problem ?
Regards
- Fatih
Hy,
I'm the author of MTLocation. Thanks for using it by the way!
For this to work you have to make sure, that your MKMapView is a subview of your ViewController's view (and not the view itself). Then you have to increase the frame of your mapView with a simple Pytaghoras - calculation: the width and height must be at least as big as the diagonal: sqrt(visibleWidth[320]^2 + visibleHeight[480-88]^2) = 506.
So that means
mapView = [[MKMapView alloc] initWithFrame:CGRectMake(-100,-100,520,520)];
Hope that helped, please consider upvoting if it fixed your problem.
You can consider using a bigger frame for the MKMapView object. It should probably be a square with each side equal to the length of the device's diagonal. The problem with this approach is that there are regions of this object that the user won't see but we process information like views for annotations related to that region anyway. Other properties like visibleMapRect would be least helpful.
Another alternative would be to be zoom in by scaling the MKMapView object on rotation. But this might make the map blurry (untested). You could zoom out on the region displayed in the map but it could lead to frequent refreshes. You can look at a middle ground where you don't zoom out until the map is rotated over a certain angle. You can also look at using two views where one of the views is off screen and updated so that it can replace the view after a certain amount of rotation so that it feels seamless.
I am working towards making my own maps application in iPhone. I want my maps to rotate as the user turns. I tried setUserTrackingMode available in iOS 5, but due to some reason it doesn't work. So I decided to take help of MTLocation framework here.
Till now I have done the following.
created a new project and copied all .m and .h files in that.
Import MapKit.h and MTLocation.h.
In Viewcontroller.h, defined property for mapView (should I define a property for locateMeItem).
In ViewDidLoad, paste the code given at the end of the page here.
I get a few errors:
Can't see the locateMe button when created programatically.
Undefined property headingEnabled.
myCustomSelector has no effect.
self.toolbar- toolbar is not a instance of ViewController.
I have tried a code at gist[dot]github[dot]com/1373050 too, but I get similar errors.
Can anybody explain a detailed procedure of this.