Crash in MapBox Example

422 views
Skip to first unread message

Niklas Nylund

unread,
May 16, 2012, 6:50:12 AM5/16/12
to route-...@googlegroups.com
Hi,

I followed this tutorial to create a MBTile package for offline maps,http://mapbox.com/tilemill/docs/guides/osm-bright-ubuntu-quickstart/
The MBTile package file itself seems to be ok as I can preview it using the Quicklook plugin but the example code from https://github.com/mapbox/mapbox-ios-example crashes when I change it to use my MBTiles files instead of the bundled control-room-0.2.0.

I get the following log in X-Code,

2012-05-16 13:42:13.825 MB Example[235:707] logged method call: -[MapView at 0,0-0,0 initWithFrame:andTilesource:] (line 204)

2012-05-16 13:42:13.834 MB Example[235:707] logged method call: -[MapView at 0,0-0,0 initWithFrame:andTilesource:centerCoordinate:zoomLevel:maxZoomLevel:minZoomLevel:backgroundImage:] (line 227)

2012-05-16 13:42:13.855 MB Example[235:707] initializing memory cache <RMMemoryCache: 0x2958f0> with capacity 32

2012-05-16 13:42:13.862 MB Example[235:707] Opening database at /var/mobile/Applications/23342DCB-284B-4C5D-931C-E4D6BB621C12/Documents/RMTileCache.db

2012-05-16 13:42:13.973 MB Example[235:707] Origin is calculated at: 21.176471, -89.976702

2012-05-16 13:42:13.991 MB Example[235:707] Map initialised. tileSource:RMMapBoxSource: MapBox Streets, zooms 0-17, no interactivity, minZoom:0.000000, maxZoom:17.000000, zoom:13.000000 at {10.220032,47.559963}

2012-05-16 13:42:13.998 MB Example[235:707] clamping min zoom of 0.000000 to 0.845490 due to RMMapMinHeightBound

2012-05-16 13:42:37.413 MB Example[235:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'

*** First throw call stack:

(0x373bb88f 0x350c0259 0x373bb789 0x373bb7ab 0x37ba305f 0x37ba2ffb 0x62adb 0x310c8c8b 0x3112863d 0x311285db 0x31127f15 0x311b1455 0x373153fd 0x310aae07 0x310aadc3 0x311b12d9 0x373153fd 0x310aae07 0x310aadc3 0x310aada1 0x310aab11 0x311b1069 0x373153fd 0x310aae07 0x310aadc3 0x310aada1 0x310aab11 0x310ab449 0x310a992b 0x310a9319 0x3108f695 0x3108ef3b 0x33ad122b 0x3738f523 0x3738f4c5 0x3738e313 0x373114a5 0x3731136d 0x33ad0439 0x310bdcd5 0x622db 0x62280)

terminate called throwing an exception(lldb) 


Any ideas of how I would go about debugging this? The MBTiles file I use can be found here: http://app.gomob.fi/fileupload/upload/OSMBright_EQvz0.mbtiles



Gmail

unread,
May 21, 2012, 12:28:22 PM5/21/12
to route-...@googlegroups.com
Hi,

I've noticed same crash while replacing mbtiles file in example app.
I've figured out that NSURL became nil when initializing with my mbtiles file.
I can preview mbtiles in Xcode and TileMill so its not corrupted.

Any suggestions?


-- 
Igor V. Asharenkov

Mob.:   +380 (91) 919-26-40
E-mail: raf.r...@gmail.com
Skype:  raf.rafiki

16 мая 2012, в 13:50, Niklas Nylund написал(а):

--
You received this message because you are subscribed to the Google Groups "route-me" group.
To view this discussion on the web visit https://groups.google.com/d/msg/route-me-map/-/1_gOBk-ibTMJ.
To post to this group, send email to route-...@googlegroups.com.
To unsubscribe from this group, send email to route-me-map...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/route-me-map?hl=en.

Justin R. Miller

unread,
May 21, 2012, 1:46:06 PM5/21/12
to route-...@googlegroups.com
Are you sure that the MBTiles is getting copied into the app bundle? Double-check that the tile source is valid and that it prints a useful description from NSLog(). 

Alan Pew

unread,
May 23, 2012, 4:56:02 AM5/23/12
to route-...@googlegroups.com
The mbtile source will crash if you are not within the min/max range of your tileset.  Commenting out the following code will avoid the crash:

NSAssert4(((tile.zoom >= self.minZoom) && (tile.zoom <= self.maxZoom)), @"%@ tried to retrieve tile with zoomLevel %d, outside source's defined range %f to %f", self, tile.zoom, self.minZoom, self.maxZoom);

Of course, this will leave you with a blank map unless you are using multiple tile sources.

Alan Pew

unread,
May 23, 2012, 4:57:24 AM5/23/12
to route-...@googlegroups.com
The mbtiles source will crash unless you are within the min/max zooms of your mbtiles source.


On Wednesday, May 16, 2012 6:50:12 AM UTC-4, Niklas Nylund wrote:

Michael Mavris

unread,
Feb 16, 2013, 6:57:58 AM2/16/13
to route-...@googlegroups.com
How can i solve this problem?? What to doy mean "you are within min/max zooms of your mbtiles source"?
Reply all
Reply to author
Forward
0 new messages