Code Monkey home page Code Monkey logo

route-me's People

Contributors

amjaliks avatar amnesic avatar baldmountain avatar bmichel avatar bradtheappguy avatar btknorr avatar colinator avatar davidgoli avatar halmueller avatar halset avatar hasseily avatar hjon avatar incanus avatar jacksonh avatar jfujita avatar josephg avatar kennygrant avatar michaeltyson avatar obrand69 avatar orff avatar pwnb0t avatar quazie avatar slainger avatar tracyharton avatar trasch avatar vyskocil avatar wrynearson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

route-me's Issues

Annotations set to strange positions

When I tried to use explicit animations instead of implicit once to improve path drawing, I have observed a strange behavior of RMAnnotation. It looks like my annotations are set to positions far out of bounds before they are set to their designated position. For example, when zooming in by double tap, my annotation is set to position

(138693.671875, 86909.796875)

before it is set to position

(100.679443, 175.798996)

I think these position changes result in artifacts when using animations. Are these strange positions intended?

rendering snapshot of map view

I've been working for quite some time on trying to get a quick UIImage snapshot of the current map view, similar to how you can do with other views using -[CALayer renderInContext:]. I've tried using both RMMapTiledLayerView's drawRect: as well as implementing drawLayer:inContext: but to no avail. The routine is (according to the standard use of CATiledLayer) only meant to handle requests for one tile at a time.

Have you ever experimented with this? I'm currently lost in the translation & scaling math to try to iteratively render tiles manually to a new context in order to stitch them together and capture an image. Wondering if you had any insight.

Parallel Tile Generation

Good evening! I hate to keep asking questions, but I've been banging my head against the wall on this one... Is there a provision to generate the tiles in parallel? Basically looking for a way for the map to request all of the tiles at once and use some kind of background processing mechanism to generate the tiles and then notify the mapview that they are ready and have the mapview draw the tiles...

Thoughts?

Thank you!

Panning through date line ?

As far as i know it's impossible to cross the data line (= longitude 180) while panning the map.

Is there a way to enable this functionality using the Alpstein fork ?

rearranging stacking order of map layers

Have you experimented at all with allowing methods on RMMapView for rearrangement of annotation layers within the private RMMapOverlayView? I need this functionality and am going to start on it, but was wondering if you had ever ventured here.

Will contribute when I get it working. I'm thinking along the lines of MKMapView's insertOverlay:aboveOverlay: et al.

retina + XIB issue

I'm rounding the bend on #59 location services, but one issue I've just noticed, which I thought was related to #57 retina assertion problem but isn't, is related to creating a map view in a XIB vs. in code.

If on a retina device and created in XIB, while the maxZoom is set property and reports properly, the scroll view can be zoomed in one level beyond, resulting in empty tiles (and failed requests for them).

In code (e.g., initWithFrame), this doesn't happen, nor does it happen on non-retina devices. I'm not using adjustTilesForRetinaDisplay, either (that was a red herring).

Any ideas? I can code up a sample if it helps, but you can see this in action with the map views in this project (code init) vs. this project (XIB init). Regardless of the behavior of the apps, try zooming in beyond the max of 17 in both.

Jittering RMPath

I have drawn a simple RMPath with two points on the map. When I zoom in or out quite fast using two finger tap, the path kind of jitters and the path sometimes even moves in from the top left corner.

Zoom to next native zoom uses odd factor

For example, I get the following output.

zoom in from:10.000000 to:10.990000 by factor:1.986185 around {136.000000,247.500000}

Furthermore, it looks as if nextNativeZoomFactor and previousNativeZoomFactor are not used.

RMPath - Bogus Layer Size?

I get this a lot when I use RM paths that are fairly distant. Any thoughts?

-[<RMPath: 0x82e9c0> display]: Ignoring bogus layer size (116573.312500, 7702.689941)

Thank you!
-Malcolm

Multiple tile sources at once

Hello,

I've made some modifications to this fork of route-me to work with multiple tile sources at once. So map view operates with a special TileSources object that responds to some methods of RMTileSource protocol and contains mutable array of tiles sources. Instead of a view for tile source that's originally placed inside of a UIScrollView I've added a simple container UIView and add/insert multiple tile source views to it. That seems to be a better way for displaying layers than adding multiple map views and syncing touch events between them (that's what google suggests for layers).

I've also done some modifications to cache code to be able to delete it for specified tiles.

I've made some work on RMGenericMercatorWMSSource, it could be found on web in multiple versions. I've chosen one and implemented a no-caching option, it was done in ARC enabled project thought.

My "fork" is not a complete solution, at least I didn't implement all the methods of RMTileSource for tile source "container", but I think it could be useful and ones who'll miss some methods could easily implement them.

I don't like the idea of creating a new fork, what about adding it to this project, probably in some separated way (in a brunch)?

Creating annotations when touches ended

This might just be a familiarization thing, but I'd like to reload my annotations when the user lifts a finger (there is some database crunching and CG calls to generate the views) instead of when the view scrolls. I implemented this in the old route-me by overriding touches ended, but with the new gestures and RMMapTiledLayerView paradigm, it's not that direct. Or at least it appears to not be.

So, before I make changes to RMMapTiledLayerView and RMMapTiledLayerViewDelegate, I wanted to see if there was any way to latch into touches ended without changing the code.

Thank you!

Capturing RMMapView into UIImage

Just curious if this is possible.. The old way of drawing into a rect isn't working anymore. I saw some closed issued around it, but I couldn't get it to work. Any thoughts? I only need to capture the current state of the map into a UIImage.

Thank you!

adjustTilesForRetinaDisplay for retina displays

Hi, I'm trying to make the map appear sharper on the iPhone 4 by setting the following:

mapView.adjustTilesForRetinaDisplay = YES;

However, I can't see any difference in the map on the device, whether I set YES or NO.

I'm setting the value in SimpleSampleMap, in viewDidLoad, before [self.view addSubview:mapView].

I've also tried setting adjustTilesForRetinaDisplay = YES in RMMapView's performInitializationWithTilesource, and setting the screenScale to 2.0 there.

is there anything else I can try?

Thanks.

Static RMPaths

Sorry about all of the posts, please let me know if there's a better "forum"-esque place to ask these questions.. Is there anyway to add a static path to the map? In the old route-me, I could do something like this to create a box RMPath: (See remark at bottom). Thank you!

if (self.nearbyItemsPath) {
if (self.nearbyItemsPath.superlayer) {
    [self.nearbyItemsPath removeFromSuperlayer];
}
    self.nearbyItemsPath = nil;
}

self.nearbyItemsPath = [[[RMPath alloc] initWithContents:self.mapView.contents] autorelease];
self.nearbyItemsPath.lineColor = [UIColor whiteColor];
self.nearbyItemsPath.fillColor = [UIColor lightGrayColor];
self.nearbyItemsPath.opacity = 0.80;
self.nearbyItemsPath.lineWidth = 3;

[self.nearbyItemsPath moveToLatLong:CLLocationCoordinate2DMake(ne_lat, ne_lon)];
[self.nearbyItemsPath addLineToLatLong:CLLocationCoordinate2DMake(sw_lat, ne_lon)];
[self.nearbyItemsPath addLineToLatLong:CLLocationCoordinate2DMake(sw_lat, sw_lon)];
[self.nearbyItemsPath addLineToLatLong:CLLocationCoordinate2DMake(ne_lat, sw_lon)];
[self.nearbyItemsPath addLineToLatLong:CLLocationCoordinate2DMake(ne_lat, ne_lon)];
self.nearbyItemsPath.zPosition = C_ZPOSITION_NEARBY_ITEMS;

// THIS IS THE KEY thing that doesn't work anymore (obviously because contents no longer exists, but is there an alternative way to do this? I have experimented with paths as annotation markers, but that is a very cumbersom way to simply add a quick static path.
[[self.mapView.contents overlay] addSublayer:self.nearbyItemsPath];

setConstraintsSouthWest: NorthEast:

I have trouble setting constraints to prevent the user from scrolling outside a specific area. I use the following code, where all variables are set to reasonable values.

define Latitude 47.56

define Longitude 10.22

self.mapView = [[RMMapView alloc] initWithFrame: fullscreen
                                  andTilesource: tileSource
                               centerCoordinate: CLLocationCoordinate2DMake(Latitude, Longitude)
                                      zoomLevel: InitialZoom
                                   maxZoomLevel: MaxZoom
                                   minZoomLevel: MinZoom
                                backgroundImage: nil];

[self.mapView setConstraintsSouthWest: CLLocationCoordinate2DMake(Latitude-0.1, Longitude-0.1)
                           northEeast: CLLocationCoordinate2DMake(Latitude+0.1, Longitude+0.1)];

With this code I am not able to move the map at all. Am I doing something utterly wrong?

If I use the original route-me implementation and invoke setConstraintSW: NE: with the same arguments the map is constraint as I would expect.

UIScrollView Bounce and Offline Data Source

Hi All,

I have been using an offline data source. The data contains tiles from a city, and extends as far as the city's limits. Currently, to show the whole city on the screen, the zoom level needed is 12.

The problem I have is that when I scroll to the edge of the city, I want the UIScrollView to 'bounce'. This is not possible though because the content size of the UIView is much bigger than the city limits.

Is there away to manipulate the scrollView to bounce within a constrained contentSize - or is this something that may need changing in the route-me code?

Any help very much appreciated.

G

Assertion failure after uncovering RMMapView

I have an application that presents a map view. First, I zoom in as far as possible. Then, I tap on a mark, which causes a new view controller to cover the map. I wait some seconds and dismiss the view controller again. After dismissing the view that covered the map, the map shows no tiles, that is, it is completely grey. But, more importantly, I get an assertion failure. More precisely, the method URLForTile in RMMapQuestOSMSource raises an exception because the current zoomLevel is 19 while it may only be 18 for the MapQuest source.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<RMMapQuestOSMSource: 0x184780> tried to retrieve tile with zoomLevel 19, outside source's defined range 1.000000 to 18.000000'

Can somebody explain me what is happing when the map view is covered?

Slow on the iPad 3?

Just curious if anyone else is seeing this.. The map seems to redraw slower on the iPad 3... It actually looks like the tiles are still being drawn at 256x256, but the higher resolution is basically making lots of smaller chunks. I might be totally off here, but it does look like it's drawing 4x as many chunks. I'm sure for people with great tiles this makes the maps look awesome especially when zoomed out, but for us, the map doesn't have a lot of detail and the higher resolution is really "taking too much time" according to the users!

Thoughts?

Thanks!

setConstraintsSouthWest:northEast & rapid pinch zoom out

I've noticed that performing a fast pinch-zoom gesture to zoom out sometimes causes the screen to go blank when setConstraintsSouthWest:northEast is used. I'm seeing this issue on the iPhone 4. Here is the constrains I'm using:

[mapView setConstraintsSouthWest:CLLocationCoordinate2DMake(51.428,-0.216))
                      northEeast:CLLocationCoordinate2DMake(51.534,-0.047)]; 

the initial coordinate is:

define kDefaultInitialLatitude 51.508

define kDefaultInitialLongitude -0.114

define kDefaultInitialZoomLevel 13.0

Sometimes is takes a couple of zoom-out gestures in succession to see the problem.

RMCircle

Seems to be off somewhat... I have a circle on a map that is 10 nm wide or 18520 meters wide and when I use

        RMCircle *c = [[RMCircle alloc] initWithView:self.mapView 
                                      radiusInMeters:arcDistanceMeters];

It is smaller than the area depicted on the map. Any thoughts? Could there be an issue with scaling at higher latitudes?
Thank you!

adding markers to mbtiles demo

Can markers be added to the mbtiles demo? If so, tips?

the moment I change to a local tile source, the markers (annotation code used from the other demos), disappear.

Implementing RMPath using CAShapeLayer

Because I had performance problems with using complex paths, I implemented a version of RMPath that uses a CAShapeLayer. First tests with a device indicate that it improves performance significantly, at least in my application. I have posted a prototype, which probably has lots of bugs, in the following gist.

https://gist.github.com/2350064

Any kind of comment is very welcome. Are there any known issues that prevent using a CAShapeLayer?

ClusterAnnotations sample?

Any plans on adding an annotation clustering sample project? Or any info on how to implement would be great.

Annotations: layer reusing

Does this make sense at all? Maybe switching to UIView would be better, since layers are less capable then views.

Truncated, hopping RMCircle with tap zooming

When zooming in using taps, it looks like the position of RMCircles on the map is altered. The circle sometimes even looks truncated by some kind of rectangle, possibly the CGRect passed to drawRect:. This issue may very likely be related to issue #29.

Map zooming and markers

When performing a double tap on a marker, the map zooms in. In contrast, when performing a two finger double tap where one of the fingers hits a marker, does not cause a zoom out but a zoom in. Furthermore, pan gestures do not zoom the map if one of the
fingers hits a marker. Would it be possible to pass all gestures except for taps on markers to the map. If there are lots of markers on the map, it is quite difficult to zoom the map by a pan gesture.

clearsContextBeforeDrawing

I have to admit that I have no experience at all in this area but when I just read the following paragraph about drawing in a view

Another way to improve drawing performance, especially during scrolling, is to set the clearsContextBeforeDrawing property of your view to NO. When this property is set to YES, UIKIt automatically fills the area to be updated by your drawRect: method with transparent black before calling your method. Setting this property to NO eliminates the overhead for that fill operation but puts the burden on your application to fill the update rectangle passed to your drawRect: method with content.

I wondered whether it is possible to set clearsContextBeforeDrawing of RMMapTiledLayerView to NO. As the opaque property of RMMapTiledLayerView is set to NO, I suspect that there are settings that use transparent tiles. Is this right? Does anybody have experience with the performance for different settings of clearsContextBeforeDrawing and opaque?

Paths disappear at high zoom levels

First, let me say thank you for this great refactoring of the route-me source. I've been using the original project for almost a year and I've just started updating my app to use this branch instead. I really like the fluid scrolling, much better memory management (still have yet to see a memory warning popup even on my testing iPad1) and the annotation/view paradigm (not to mention the CLLocationCoordinate2D usage and consolidated RMMapView and contents.

However, one thing I'm seeing that is a problem (at least for me) is that I can't seem to figure out how to just add static RMPaths to the map and then I implement them as annotations with layers, they are hidden at high zoom levels (for an obvious reason -- the "coordinate" of the path is offscreen so they are hidden). I experimented with adding a canHide boolean to the RMAnnotation and changing the RMMapView to check that before hiding it. That worked but then I ran across the invalid layer size issue.

Any thoughts?

Thank you!

marker label taps not working

Do you see marker label taps work? I don't, and digging into the hitTest: in RMMapOverlayView, I don't see the label's layer ever show up, including when (manually) setting the label's userInteractionEnabled to YES.

zoomfactor increases (incorect) after switching view/tab on retina and tiles display att scaled factor

Hi All,

issue:
after switching view/tab on retina phone the zoomfactor increases and tiles display att scaled factor

details:
I have a multi tab app that has a mapview on the first tab. and i did set the mapView.adjustTilesForRetinaDisplay = YES; and a default zoomlevel of 1. I put some debugging on RMMapTiledLayerView, drawRect

when the app loads the output all tiles load att zoomlevel 1 and the maps displays.
See the output of listing 1 for the loggin on drawRect
After that i click on the second tab and than i click back to the tab containing the map. (NOTE: i do not zoom, drag or touch the map).
the map reloads directly ( on the non-retina display it does not redraw) and the zoom level is incorrect
See the output of listing 2 for the loggin on drawRect

after this all tiles are displayed scaled by a factor half.

regards Gijs

********** listing 1: output att startup *************
2012-02-24 13:43:38.041 gwfm[1672:fb03] Map initialised. tileSource:<RMOpenStreetMapSource: 0x6b89ea0>, minZoom:1.000000, maxZoom:6.000000, zoom:6.000000 at {10.217285,47.554287}
2012-02-24 13:43:38.322 gwfm[1672:13603] Tile @ x:1, y:1, zoom:1, rect.size.width:128.000000
2012-02-24 13:43:38.324 gwfm[1672:11907] Tile @ x:0, y:1, zoom:1, rect.size.width:128.000000
2012-02-24 13:43:39.298 gwfm[1672:13603] Tile @ x:0, y:1, zoom:1, rect.size.width:128.000000
2012-02-24 13:43:39.567 gwfm[1672:11907] Tile @ x:1, y:0, zoom:1, rect.size.width:128.000000
2012-02-24 13:43:40.233 gwfm[1672:13603] Tile @ x:1, y:0, zoom:1, rect.size.width:128.000000
2012-02-24 13:43:40.322 gwfm[1672:13603] Tile @ x:0, y:0, zoom:1, rect.size.width:128.000000
2012-02-24 13:43:40.621 gwfm[1672:11907] Tile @ x:0, y:0, zoom:1, rect.size.width:128.000000

********** listing 2: output after switching tabs *************

2012-02-24 13:51:09.800 gwfm[1672:16b27] Tile @ x:2, y:3, zoom:3, rect.size.width:32.000000
2012-02-24 13:51:09.803 gwfm[1672:16a23] Tile @ x:2, y:2, zoom:3, rect.size.width:32.000000
2012-02-24 13:51:10.509 gwfm[1672:16a23] Tile @ x:2, y:2, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:10.622 gwfm[1672:16b27] Tile @ x:2, y:2, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:11.103 gwfm[1672:16a23] Tile @ x:2, y:3, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:11.343 gwfm[1672:16b27] Tile @ x:2, y:3, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:11.469 gwfm[1672:16b27] Tile @ x:3, y:2, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:11.772 gwfm[1672:16a23] Tile @ x:3, y:2, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:11.854 gwfm[1672:16a23] Tile @ x:1, y:2, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:12.160 gwfm[1672:16b27] Tile @ x:1, y:2, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:12.655 gwfm[1672:16a23] Tile @ x:2, y:1, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:12.902 gwfm[1672:16b27] Tile @ x:2, y:1, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:13.199 gwfm[1672:16a23] Tile @ x:3, y:3, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:13.672 gwfm[1672:16b27] Tile @ x:3, y:3, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:13.812 gwfm[1672:16a23] Tile @ x:1, y:3, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:13.954 gwfm[1672:16b27] Tile @ x:1, y:3, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:14.353 gwfm[1672:16a23] Tile @ x:3, y:1, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:14.464 gwfm[1672:16b27] Tile @ x:3, y:1, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:14.843 gwfm[1672:16a23] Tile @ x:1, y:1, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:15.028 gwfm[1672:16b27] Tile @ x:1, y:1, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:15.380 gwfm[1672:16a23] Tile @ x:2, y:0, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:15.893 gwfm[1672:16a23] Tile @ x:3, y:0, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:16.286 gwfm[1672:16b27] Tile @ x:3, y:0, zoom:2, rect.size.width:64.000000
2012-02-24 13:51:16.454 gwfm[1672:16a23] Tile @ x:1, y:0, zoom:2, rect.size.width:64.000000

MapBox/TileStream changes (pull request not working)

I tried to do this over in #41, but GitHub is being odd in that it's trying to relate your fork and Route-Me core instead of just the one commit that I wanted to send to you.

Anyway, the commit is 287f307887ef190bd0957a3c7846de942af7d379 and is described in Route-Me core here. I've replicated the changes for your fork as well, since that's what I'm using these days.

Let me know if you'll consider it for your fork.

double-tap on map zooms slower than markers

If you double-tap the map to zoom it in, the markers all jump to their new places before the map finishes the zoom animation.

And to be clear, I'm going to try to help with these issues -- just jotting them down :-)

Resizing RMMapLayer

Good morning! I've run into something else that I'm hoping is just user error... I am returning a RMMapLayer that has an image assigned to it (e.g.: layer.contents = image), but the layer is not being resized during zoom... When I scroll off the annotation and back on, it is ok (the layerForAnnotation sizes it depending on zoom). Is this something that this library will natively support or do I need to add something.

Thank you!

rotating map view?

@trasch, have you any experience with rotating either the whole map view or the tiled layer? I have been working on a an app over at https://github.com/mapbox/mapbox-me that behaves like Maps.app and has a tracking dot, halo, and compass directional, as well as a rotating map view, but I've faked it by making the map view bigger than specified in order to not show background when being rotated at a diagonal.

Looks like this:

Any ideas for a better approach? I'd like to contribute the code back to the project directly so that it behaves more like iOS 5's MapKit -- right now it's just contained in this app's logic.

boundingMask not limiting pinch-zooming

Is it intended behavior that the boundingMask limits only two-finger tap zooming out, but not pinch gestures? I can zoom out far enough that the view background is visible.

Just curious if this is known -- I'll take a look at it but wanted any background info first.

map unresponsive with a lot of markers

After adding several hundred markers, I find local map sources almost unresponsive for zooming, or dragging the map. Is this a known problem? I've never had a problem doing the same with mapkit.

Leaf clustering

When using clustering, the annotations in the leaf nodes will be added unclustered to the map. This might be a problem for annotations that are close together.

Assertion failure with retina display

My application crashes with an assertion failure in URLForTile when I zoom in quickly in the simulator with retina display or on a device with retina display. Is it possible that commit 7a452e7 has introduced a bug.

possible method rename

Does it make sense to rename screenCoordinatesForAnnotation:? As I found out recently, it's not really the annotation's position on screen, but rather in its super view (effectively, the map view).

Multiple Calls to Draw Rect?

During the course of this attempt to parallize the drawRect method, I noticed that it seems drawRect is called multiple times in succession for the same tile..

2012-03-01 04:02:18.591 i1000[22689:530b] Tile @ x:4097, y:4094, zoom:13
2012-03-01 04:02:18.614 i1000[22689:7c03] Tile @ x:4097, y:4094, zoom:13
2012-03-01 04:02:18.629 i1000[22689:530b] Tile @ x:4095, y:4094, zoom:13
2012-03-01 04:02:18.653 i1000[22689:7c03] Tile @ x:4095, y:4094, zoom:13
2012-03-01 04:02:18.662 i1000[22689:530b] Tile @ x:4094, y:4094, zoom:13
2012-03-01 04:02:18.690 i1000[22689:7c03] Tile @ x:4094, y:4094, zoom:13

it doesn't seem to matter what zoom level or location..
2012-03-01 04:04:53.630 i1000[22689:537f] Tile @ x:40, y:45, zoom:7
2012-03-01 04:04:53.664 i1000[22689:a64b] Tile @ x:40, y:45, zoom:7
2012-03-01 04:04:53.701 i1000[22689:537f] Tile @ x:38, y:45, zoom:7
2012-03-01 04:04:53.738 i1000[22689:a64b] Tile @ x:38, y:45, zoom:7
2012-03-01 04:04:53.789 i1000[22689:537f] Tile @ x:37, y:45, zoom:7
2012-03-01 04:04:53.830 i1000[22689:a64b] Tile @ x:37, y:45, zoom:7

A breakpoint in drawRect does reveal that the call is being made on two different threads.

Here's the current drawRect that I'm working with:

-(void)drawRect:(CGRect)rect {
CGRect bounds = self.bounds;

//    NSLog(@"drawRect: {{%f,%f},{%f,%f}}", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);

short zoom = log2(bounds.size.width / rect.size.width);
int x = floor(rect.origin.x / rect.size.width), y = floor(fabs(rect.origin.y / rect.size.height));
NSLog(@"Tile @ x:%d, y:%d, zoom:%d", x, y, zoom);

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

UIImage *tileImage = [[mapView tileSource] imageForTile:RMTileMake(x, y, zoom) inCache:[mapView tileCache]];
[tileImage drawInRect:rect];

[pool release]; pool = nil;

}

Any thoughts? This would definately slow down my app because the processing of the images takes a little time.

Thanks!

Sample code cleanup

o Merge sample code which does the same
o Show off more features
o Better documentation (readd doxygen?)
o Unit tests

Zooming breaks constraints

Todo: Prevent zoom levels that would show more than the constraint area. (i.e. set a maximum zoom level so that all bounds are just inside the visible area)

MarkerManager moveMarker?

This project doesn't contain MarkerManager class, so I wonder if there's a smooth way to move markers/annotations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.