Discussion Forums  >  Uncategorized

Replies: 7    Views: 350

steveh6883
buzztouch Evangelist
Profile
Posts: 383
Reg: May 15, 2011
Gosport, UK
3,830
08/17/11 01:22 PM (14 years ago)

Enable 'MyLocationOverlay'?

Anyone managed to enable the 'mylocationoverlay' feature in GoogleMaps? (the blue pin that shows the current users location on google map) Think I'm missing something very obvious here, but have so many projects and pages of code am working through I think I'm going 'snow blind' :) Steve
 
steveh6883
buzztouch Evangelist
Profile
Posts: 383
Reg: May 15, 2011
Gosport, UK
3,830
like
08/17/11 01:23 PM (14 years ago)
Ops ... sorry - Android/Eclipse
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/18/11 12:24 PM (14 years ago)
I'm guessing you're working with an HTML view of GoogleMaps and not the native Android Google Maps? I've not worked with any of this library before other than the map stuff on the buzztouch control panel. This doc, at the end, mentions what browsers are supported: http://maps.google.com/support/bin/answer.py?hl=en&answer=153802 I wonder if the Mobile Android browser would run it? Not sure.
 
steveh6883
buzztouch Evangelist
Profile
Posts: 383
Reg: May 15, 2011
Gosport, UK
3,830
like
08/18/11 02:22 PM (14 years ago)
No - working with Android GoogleMaps - 'MyLocationOverlay' is there even in Buzztouch, just can't figure how to turn it on
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/18/11 09:30 PM (14 years ago)
Funny, I missunderstood. The users location should show on the map. This is a little phone icon and not a pin drop. Open Screen_LocationMap.java file, scroll down to about line 320 and see the showMapPins method. This is the method that drops the pins on the map. On line 349 you'll see the part where it adds a graphic (youarehere.png from res folder) to show the location of the device. You'll also see where it does NOT do this it the appDelegate.currentDevice.deviceLatitude is not availalbe (less than four characters is like saying 'this can't be a valid location). Maybe put some log statements in this method to see what is and isn't running? You could also do some log statements to see what the current value of the device's location data is?
 
steveh6883
buzztouch Evangelist
Profile
Posts: 383
Reg: May 15, 2011
Gosport, UK
3,830
like
08/19/11 07:28 AM (14 years ago)
Thanks David, will take a look and see whats not and what is happening & get back to you
 
steveh6883
buzztouch Evangelist
Profile
Posts: 383
Reg: May 15, 2011
Gosport, UK
3,830
like
08/20/11 06:17 AM (14 years ago)
Hmmm....seeing everything as it should (I think) but not getting any result on device ******************************************************************************************************************* //overlay item.. OverlayItem overlayitem = new OverlayItem(thisLocation.point, thisLocation.annotationTitle, thisLocation.annotationSubTitle); Drawable pinGraphic = this.getResources().getDrawable(R.drawable.map_marker_red); overlayitem.setState(pinGraphic, 0); itemizedOverlay.addOverlay(overlayitem, pinGraphic); //add point to list myPoints.add(thisLocation.point); }//end for.. //add device location if we have it.. if(appDelegate.currentDevice.deviceLatitude.length() > 4){ Obj_MapLocation deviceLoc = new Obj_MapLocation(, , 1); deviceLoc.latitude = appDelegate.currentDevice.deviceLatitude; deviceLoc.longitude = appDelegate.currentDevice.deviceLongitude; deviceLoc.annotationTitle = ; deviceLoc.annotationSubTitle = ; deviceLoc.point = getPoint(Double.parseDouble(deviceLoc.latitude), Double.parseDouble(deviceLoc.longitude)); deviceLoc.detailsTitle = ; deviceLoc.detailsURL = ; OverlayItem overlayitem = new OverlayItem(deviceLoc.point, deviceLoc.annotationTitle, deviceLoc.annotationSubTitle); Drawable pinGraphic = this.getResources().getDrawable(R.drawable.youarehere); overlayitem.setState(pinGraphic, 0); itemizedOverlay.addOverlay(overlayitem, pinGraphic); myLocationObjects.add(deviceLoc); myPoints.add(deviceLoc.point); } **************************************************************************************************************
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/21/11 01:34 AM (14 years ago)
See if you can print to the console right after the myPoints.add(deviceLoc.point) line. This will help determine what is and what isn't happening. We'll need to see if it's adding it to the map but just not showing it or not adding it at all.
 

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.