Discussion Forums  >  Uncategorized

Replies: 5    Views: 538

Yap Attack! Dev Team
Aspiring developer
Profile
Posts: 21
Reg: Jan 25, 2011
Rutgers
210
03/24/11 10:38 AM (14 years ago)

Manipulating map center on an android device

Hello Buzztouch world, I'll try to keep the question as general as possible to allow for more input from different people. Essentially, we have an app which takes a users current location and performs a search. (this is all taken care of already, so that much works). The bizarre part of the problem is the location that the map opens with. Essentially, the map knows where the device is, and searches the correct thing, but centers itself over new york city! Hitting the 'my current location' button on the map re-orients the map to be directly over the devices location, which is where we want it to start. We think that we need to concatenate something with the url we are using, which would re-center the map at the user's location. However, we aren't quite sure how to do that. We found a google maps URL parameter called 'sll' which seems promising, but we don't know that much about it. Any help would be appreciated, thanks everyone. -Yap Attack! Dev Team
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/24/11 09:36 PM (14 years ago)
Hey Yappers' Android right? So, centering the map is done in the setMapBoundsToPois() method. This method is in the Screen_LocationMap.java file. However, if you are not using a buzztouch map, and instead are using a google map in a web-view. If this is the case, Screen_LocationMap.java has nothing to do with it. In face, in this case, your Android project is not doing anything map related, the Google Maps web page is. I guesst this means we need to determine what map type you're using first... then figure out how to center the map on the device's location.
 
Yap Attack! Dev Te...
Aspiring developer
Profile
Posts: 21
Reg: Jan 25, 2011
Rutgers
210
like
03/25/11 01:07 PM (14 years ago)
Hey David, Correct, we're talking android here. As of now, the way we have it set up is to open the URL in the native browser on the android device (since location information seems 'lost' whenever the buzztouch browser is launched). If need be, we can have the map open in the buzztouch browser and use the method you just mentioned. The only potential problem is if we begin having trouble with the location information (which is why we switched to the native browser anyway). That being said, I believe we have our URL (which contains maps.google.com) opening in the native browser and NOT the google maps app. (we changed the source code for this to happen). Hopefully some of that helps! Thanks again, -Yap Attack! Dev Team
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/25/11 03:30 PM (14 years ago)
BTW: Are you a Rutgers student or student club? What the heck is Yap Attack! Dev Team. Gimme some perspective - seems cool.
 
Yap Attack! Dev Te...
Aspiring developer
Profile
Posts: 21
Reg: Jan 25, 2011
Rutgers
210
like
03/25/11 03:54 PM (14 years ago)
We are actually two Rutgers Biomedical Engineering students who learned a bit of programming and just got into this stuff for fun. Its been really cool learning how this all works, since this is our first app its been quite the learning process haha. Were not affiliated with the school through any clubs or anything, but we both live there on campus. This particular app is for a friend of our's local clothing company, they have a bit of a retro-style goin on so they figured it would be cool to have a diner finder app, as well as to handle promotional stuff to keep in direct contact with their customers. Their website is http://www.karmacartel.com . We're thinking about going around to some of the local businesses to start making some apps for them, or even some bands who want to connect with their fans. As far as the issue were having now goes.. it seems that when the native browser opens, and our query diner along with the users latitude and longitude being included in the URL in their respective parameters, it ignores the users location and centers the map right in the heart of NYC. We know it understands where the user is because when we hit the use current location button provided on the Google Maps interface, the map re-centers over our users location. Which we could just tell people to deal with it, because thats the way it works, but it would be convenient to be able to do this without the user having to hit any button... I mean, Im sure these diners in NYC are nice and all, but theyre a bit of a hike from where most of the people using this app are going to be...
 
Zoid66
Lost but trying
Profile
Posts: 176
Reg: Oct 26, 2010
USA
1,760
like
03/25/11 10:52 PM (14 years ago)
The map location is lost because see post GeoLocation In Webview Android. I have not been able to get this working yet... Can you post one of the URL's? I want try it on my device: I belive it has something to do with preference'
 

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.