tiger
Aspiring developer
Profile
Posts: 121
Reg: Dec 26, 2010
USA
1,210
04/13/12 03:54 PM (13 years ago)

Android Zoom in new version

Hi, Here are my previous notes from when I created my maps with 1.5 when it first came out. I know some of the screen names have changed and the line numbers have changed. I made my changes to the BT_screen_map.java because that's where I found mapController.animateTo(items.get(0)); It's not working. Does anyone know how to fix the zoom and make it increase the zoom of the location so it's closer? Here's my old notes. Android Default Zoom Change You may have noticed that on Android the 'default zoom' doesn't do much. To hard-code the zoom level, on a map with only one location marker... do this a) Find Screen_LocationMap.java in the /src folder of the Eclipse project b) Scroll down to around line 383 and look for mapController.animateTo(items.get(0)); c) Just below that (press enter after that line to give yourself some space... Add this: mapController.setZoom(18);
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/13/12 04:22 PM (13 years ago)
Following
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/13/12 06:43 PM (13 years ago)
Hi @tiger, Are you saying that the "Single Location Default Zoom (1-28)" feature in the v1.5 Map Location screen doesn't work? The text next to it says it does for a single location. Mark
 
tiger
Aspiring developer
Profile
Posts: 121
Reg: Dec 26, 2010
USA
1,210
like
04/13/12 06:45 PM (13 years ago)
Not on my app. It's still far away from the actual location.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
04/14/12 03:03 AM (13 years ago)
If you're still working in v1.5, look for the setMapBoundsToPois() method. This is on about line 772 in BT_screen_map.java. It goes like this... a) Map reads location data in the parseScreenData() method b) When this method completes, it fires the showMapPins() method, this is the method that drops all the pins on the map. When it completes, it fires the setMapBoundsToPois() method. This method is used to "center" the map around all the possible locations. If you're using one location, it's logical then that you would do the "zoom" after the map has centered around the location. So, scroll near end of the setMapBoundsToPois() method, to about line 815 or so. Just above (just before) the map is invalidated with mapView.invalidat(), add your mapController.setZoom(18) like... mapController.setZoom(18); //invalidate to "refresh" map mapView.invalidate(); The logic will be nearly the same (different line numbers) if you're using v2.0 and the map plugin. Bet it works.
 
tiger
Aspiring developer
Profile
Posts: 121
Reg: Dec 26, 2010
USA
1,210
like
04/14/12 07:35 AM (13 years ago)
Thanks David I'm almost there. The zoom is working. But, the location is off the screen. I decrease the setZoom to (14) and I could see the pin way over to the right, almost off the screen. Therefore, when I increase the zoom to (18) it's off the screen. In other words, the pin is not showing up in the middle of the screen or close to the middle. I put the code inside } and outside the } Any advice.
 
tiger
Aspiring developer
Profile
Posts: 121
Reg: Dec 26, 2010
USA
1,210
like
04/14/12 10:41 AM (13 years ago)
Hi again, I've been reading the board and testing my app. I notice the zoom works sometime and sometime it does not in the Android app only. I don't have any of these problems in the iphone version. I always clean my android app if I try anything new and I make sure I select the top line of my project, xxxv15_android. I'm reading the board and I saw similar problems but non of the solutions I've read so far solves my problems. If anyone had my problem and resolved it, please let me know.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/14/12 10:58 AM (13 years ago)
Do you have report current location set, which would put you in the middle of the screen? Mark
 
tiger
Aspiring developer
Profile
Posts: 121
Reg: Dec 26, 2010
USA
1,210
like
04/14/12 11:24 AM (13 years ago)
Hi Mark, Not sure where to find that. I'm looking in BT-screen_map.java I see currentDevice.location, streetcarlines_appDelegate.rootApp.setCurrentScreenData(screenData);, I also checked BT-screen_settingsLocaiton.java Am I looking in the wrong location. Part of me thinking it the problem may be my android phone. I've been using it for testing. I always delete my app and sometimes remove the battery, but I think maybe the phone is holding old settings. It's working in the simulator.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/14/12 11:28 AM (13 years ago)
It should be a setting in the Advanced Properties section of the Location Map screen. But, if it's working in the simulator, and not on the phone..yeah, it could be due to a unique aspect of the phone. Mark
 
tiger
Aspiring developer
Profile
Posts: 121
Reg: Dec 26, 2010
USA
1,210
like
04/14/12 11:31 AM (13 years ago)
deleted
 

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.