-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to have mbtiles outside of bundle dir #10
Comments
@firefountain did you find a way to achieve this ? |
My priorities shifted to another issue. But a little bit of research showed that you can changed it on the source code in iOS. Dig a bit. You need to chance a few things when you load the map. RMMBTilesSource |
Sorry haven't had any free time to spend on this due to work and personal obligations -- yes this should be possible with some changes with referencing the path in RMMBTilesSource. When I get a chance I will take a look. |
Ok, thanks guys i make some changes in RMMBTilesSource and ComPolancomediaMapboxView.m to do the thing. Now i'll try to add eventlistener 'click' on annotation popup |
@arshavinho Care to share the code? I can give you the event listener for the "click" on annotation. Already have that made! |
@firefountain yes, did you have make anothers features ? I'm really not comfortable with objC so to have mbtiles outside of bundle dir, i don't produce an optimized code. I will post my code tomorow but the trick is to use - (id)initWithTileSetURL:(NSURL *)tileSetURL and set "map" with Ti.Filesystem.getFile(path_to_mbtiles).resolve() var mapView = mapbox.createView({
// map: '/maps/road-trip',
map: Ti.Filesystem.getFile(path_to_mbtiles).resolve(),
minZoom: 7,
maxZoom: 12,
zoom: 9,
centerLatLng: [18.467354,-91.903534],
width: Ti.UI.FILL,
height: Ti.UI.FILL,
debugTiles:true
}); |
@arshavinho Could you share your code? Thanks! fyi: |
All, sorry for being offline for a while, been busy moving to another country. I will hopefully have some more availability in the coming weeks to help with some of the new stuff people want implemented. |
Yes, i comment line 62 - 77 in ComPolancomediaMapboxView.m and add: mapSource = [[RMMBTilesSource alloc] initWithTileSetURL:[NSURL fileURLWithPath:mapPath]]; You need to send the mbtiles file path with .resolve() : var mapView = mapbox.createView({
// map: '/maps/road-trip',
map: Ti.Filesystem.getFile(path_to_mbtiles).resolve(),
minZoom: 7,
maxZoom: 12,
zoom: 9,
centerLatLng: [18.467354,-91.903534],
width: Ti.UI.FILL,
height: Ti.UI.FILL,
debugTiles:true
}); |
@adampax i noticed that the memory used isn't release when we close the window, did you notice ? |
@arshavinho I'm going to open a new issue and drop my code there. Easier to control There you go! |
You think you could proof and incorporate my code...I think I'm on the right track. I can't test as I can't figure out how to compile! I want to still be able to use the resources directory (default) for testing but also need the ability to download maps OTA or via iTunes and use them. Thanks!
|
@nitrag |
I thought the resources directory was read-only? So a download would land Download mbtiles from internet to save for offline use. <--trying to
|
Yes you are right, the resource dir is read only. But you can access application dir with the module. |
This still required the modification to ComPolancomediaMapboxView.m thought right? I can't get the module to build for the life of me. Can anyone provide exact steps from cloning the git to building app? I'm probably missing some small detail. I would really like to contribute to this repo. |
OK I figured it out. Had to build with 3.4.1. Will attempt with 3.5.0 tomorrow and post my working code for both the AppData or Resources data file locations! |
Right now.. I can't for the life of me figure out a way to get the sdk to read mbtiles that are not bundled with the app.
If we want to download a map after the app is compiled, its impossible to load it up..Everything get's downloaded to the Documents dir, outside the bundle.
Anyway to quickly change it?
The text was updated successfully, but these errors were encountered: