Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 93

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
04/17/15 05:35 AM (9 years ago)

preclude to an Update: Smugs Offline Map Kit (Android)

Howdy. Just thought you might like to know I've made a few improvements to the Smug Offline Map Kit. Most notably, the correct method to 'limit' the map to bounds. This is done automatically in iOS, but has long been an annoyance in Android. It will be in the next update, but for those who need it *now* I will outline the basic procedure: around line 179 or so of the SW_offlineMapKit.java file, just after this line: "this.mapView = new SW_offlineMapView(thisScreensView.getContext(), swolmk_mapDB);" Insert these lines: BoundingBoxE6 mapBounds = new BoundingBoxE6(N, E, S, W); this.mapView.setScrollableAreaLimit(mapBounds); You need to get the values for your Maps North, South, East and West coordinates. When finished it will look similar to this: BoundingBoxE6 mapBounds = new BoundingBoxE6(13.304103, 144.777811, 13.25066, 144.7229); this.mapView.setScrollableAreaLimit(mapBounds); I will be adding an additional 'configuration panel' in the plugin control panel for these values. For this very moment, you can hard code them to a particular project. If you don't know where to get the values, try checking the Mobac profile you used to create the map. Otherwise, if you created an iOS Map, you can use an SQLite utility and it will be in the header information. Sadly, the Android SQLite DB Does not have this info. Worst case basis, create a new map, and record those values. Again, an update will be forthcoming, but I'm trying to button up this project so I'm pressed for time. Cheers! -- Smug
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
04/17/15 05:37 AM (9 years ago)
Thank you! LA
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
04/17/15 10:05 PM (9 years ago)
I need to try this plugin. It is just so cool to have maps offline!
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
04/18/15 01:28 AM (9 years ago)
Good one Smug, will hardcode it in the next days and let you know if it works
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/18/15 01:33 AM (9 years ago)
I gotta say Leon, it's like all things android; a bit odd to understand... What it seems to do is limit the scrolling of the area to those defined. Great. But still, you can concievably zoom out far further than the boundaries; you still need to implement a min/max zoom to adaquately implement the feature. If the user zooms 'too far out' and the boundaries of the screen exceed those of your parameters (assuming it's the map), It will display your map with those ugly grey areas outside, but it won't allow for any scrolling of the map. makes sense, but you'd think they'd limit the min/max zoom as well. Of course, that could be something I'm supposed to do. I'm looking into other display properties, and am almost finished with my last eclipse project, and hope to take a look at the mapbox sdk for Android... It's based on the same jar file I use now, so hopefully a lot of work will already be done, and in a better fashion, lol! Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.