3 ms·
I'm curious about your experiences with what sounds like a JS maps frontend in an iOS app, versus native Objective-C. Could you elaborate a bit on your decision
by incanus77 15y ago
I'm curious about your experiences with what sounds like a JS maps frontend in an iOS app, versus native Objective-C. Could you elaborate a bit on your decision there?
- untog 15y agoDecision in terms of why I chose JS over Obj-C? I had intended to make as much of the app cross-platform as possible, so I was predisposed to use HTML5/JS in the first place- 95% of the app will be directly transferable to Android. I'm also not sure if you can use custom map tiles with the native map control in iOS- I've certainly never seen anyone do so. Although I'm not yet taking advantage of it in the app, the ability to cache map tiles locally is also a great plus. I'm extremely happy with the end result- it really does work as well as the native map control. In fact, I found a demo here: http://leaflet.cloudmade.com/examples/mobile-example.html http://leaflet.cloudmade.com/examples/mobile-example.html It's a little more work to get it looking as good, but nothing some CSS3 can't fix (box shadows, rounded corners and the like). The story is a little different on Android as pinch-to-zoom doesn't work, but I think that's a WebKit flaw, rather than a leaflet.js flaw.
- incanus77 15y agoYou can't use the native map control (MapKit) but you can use an alternative: https://github.com/mapbox/route-me https://github.com/mapbox/route-me https://github.com/mapbox/mbtiles-ios-example https://github.com/mapbox/mbtiles-ios-example https://github.com/mapbox/tilestream-ios-example https://github.com/mapbox/tilestream-ios-example The main advantage over JS is the ability to go offline, as well as performance. But that's largely negated if you need to go cross-platform as you do, where I think JS does make a lot of sense.
- untog 15y agoI've played around with extending the T.TileLayer to save remote tiles then try to load then using file:// in the future. It mostly worked, but I didn't have time to totally tweak it- my app is being entered into a competition with a deadline. I fully intend to investigate offline JS maps in the future, though.