iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
991 stars 552 forks source link

Feature request: add a marker with you current location on the map #179

Closed fretje closed 11 years ago

fretje commented 11 years ago

Use case: When I'm on the road in a region that I'm unfamiliar with, I find myself switching between the scanner and the intel map quite often, but it's not always easy to see where exactly you are on the intel map. I know there's the "get location" button, but this only centers the map to your location. Still I'm not always able to easily see where exactly I am.

It would be nice if there was a marker shown on the map with your current location. Maybe this could be added as another layer to the layer control?

vita10gy commented 11 years ago

Click on "poslinks" (in the info tab)

jonatkins commented 11 years ago

I like this idea, yes. A moving marker would be ideal, but may not be practical. Dropping a marker when choosing your current location should be easy enough though.

vita10gy commented 11 years ago

Whoops. I mixed up threads. Disregard pos links comment

vita10gy commented 11 years ago

Agreed, this would be a nice add. Even a good reason to use that cool purple marker that someone made with the player tracker ones.

jonatkins commented 11 years ago

the purple marker used for draw tools? Yes, I guess it could be re-used for this too :)

vita10gy commented 11 years ago

Hrm, I guess it is.

leCradle commented 11 years ago

I'm on it... :)

leCradle commented 11 years ago

Needs a few tests on other devices here is the apk: http://iitcm.code-noobs.org/IITC-Mobile-latest.apk

Seems to work good on Nexus 4 with Android 4.2.2 The app ignores all locations with an accuracy > 100 meters...I think that should be enough to 1. avoid gps glitches and 2. match all gps modules.

Please comment if it does not work for you.

fretje commented 11 years ago

I tried it on my Galaxy S3 with android 4.1.1

2 Problems:

leCradle commented 11 years ago

@fretje Thx for your feedback.

fretje commented 11 years ago

Ok, I tried the location_debug version, and I think the problem is indeed with the accuracy. I got 5 location events in the debug tab, but the accuracy is never less than 100... first time was 250, then 192, then 3 times 128.

About the 'Get Location' icon (maybe I should open a new issue with that?): it doesn't even move the map. It literally does nothing. It used to work before though...

On Mon, Apr 29, 2013 at 8:58 AM, Philipp Schaefer notifications@github.comwrote:

@fretje https://github.com/fretje Thx for your feedback.

  • It sounds like you get no network- or gps-fix? The location-script initializes the marker at the center of the map. If you get a location-fix (network [wifi!!...mobile network is not accurate enough] or gps) the marker is moved to the correct location.
  • Yep the "Get Location" icon only centers the map to your current location...it has nothing to do with the marker. The marker is triggered by an Android LocationChanged() Event.
  • With this apk the debug tab is spamed with location updates http://iitcm.code-noobs.org/IITC_Mobile_location_debug.apk ... please have a look at the output. Is it gps or from network? How about the accuracy (acc)? Should be smaller then 100 if you have your location fixed.

— Reply to this email directly or view it on GitHubhttps://github.com/jonatkins/ingress-intel-total-conversion/issues/179#issuecomment-17152388 .

leCradle commented 11 years ago

@fretje allright...sounds like you have a network fix and no gps fix? Is the output like Location[gps 49.399917,8.687288 acc=32 et=+6d22h31m18s791ms alt=165.89999389648438 vel=0.0 {Bundle[mParcelledData.dataSize=44]}] or Location[network 49.399890,8.687292 acc=49 et=+7d1h9m1s730ms {Bundle[mParcelledData.dataSize=600]}] ?

That 'Get Location' doesn't even move the map, sounds very strange...are you sure that 1) the map has to be moved (try focusing another town and then press the 'Get Location' Button) 2) you have GPS satellites AND Wi-Fi & mobile network location enabled in Android Settings -> Location access

fretje commented 11 years ago

This is what I get in the debug tab:

11:55:14 notice Location[mProvider=gps,mTime=1367229317105,mLatitude=51.06304510839496,mLongitude=3.7519997053680325,mHasAltitude=true,mAltitude=58.52061068367365,mHasSpeed=true,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=true,mAccuracy=128.0,mExtras=Bundle[mParcelledData.dataSize=44]] 11:55:13 notice Location[mProvider=gps,mTime=1367229316105,mLatitude=51.06304510839496,mLongitude=3.7519997053680325,mHasAltitude=true,mAltitude=58.52061068367365,mHasSpeed=true,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=true,mAccuracy=128.0,mExtras=Bundle[mParcelledData.dataSize=44]] 11:55:12 notice Location[mProvider=gps,mTime=1367229315105,mLatitude=51.06304510839496,mLongitude=3.7519997053680325,mHasAltitude=true,mAltitude=58.52061068367365,mHasSpeed=true,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=true,mAccuracy=128.0,mExtras=Bundle[mParcelledData.dataSize=44]] 11:55:11 notice Location[mProvider=gps,mTime=1367229314112,mLatitude=51.06304510839496,mLongitude=3.7519997053680325,mHasAltitude=true,mAltitude=49.45464697494659,mHasSpeed=true,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=true,mAccuracy=192.0,mExtras=Bundle[mParcelledData.dataSize=44]] 11:55:10 notice Location[mProvider=gps,mTime=1367229313104,mLatitude=51.063216171700425,mLongitude=3.751845807687674,mHasAltitude=true,mAltitude=55.98242963583517,mHasSpeed=true,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=true,mAccuracy=250.0,mExtras=Bundle[mParcelledData.dataSize=44]]

Everything "location-wise" is enabled in the android settings, but I must say I'm testing inside right now. Didn't have the time yet to actually test it "in the field"... so it's possible that gps isn't working here...

OTOH, google maps shows my location very accurate even here inside.

About the "Get Location": I'm sure the map has to be moved. I tried what you suggested (focused on another town). Pressing the button still does nothing.

leCradle commented 11 years ago

@fretje Thx for your feedback. Ok...test the gps outside again (when you have time to do it), then it should get better accuracies. It is strange, that you only get gps notification, because every 20 s it should get a location from network. But this would explain, why 'Get Location' does not work...because it gets the location exclusively from network.

fretje commented 11 years ago

Ok, once I went outside the gps fix was very accurate and so was the marker position.

I did some research and found out there's apparently an issue with some phones (android versions) and network location fixes:

http://stackoverflow.com/questions/13594932/network-provider-not-providing-updated-locations

The only solution for this I found right now is rebooting the phone, and after I did, I started to receive network location events as well... so this is probably a bug in the android system... Although the google maps application doesn't seem to have a problem with it :-s

Maybe this article can give more insight and you might be able to work around this issue (not really necessary, but it's never bad to implement "best practices"):

http://android-developers.blogspot.kr/2011/06/deep-dive-into-location.html

leCradle commented 11 years ago

@fretje thanks! I will definitely have a look at this. :)