Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useCurrentLocation but it does not pop the address on default #21

Closed
newbieflutter opened this issue Mar 30, 2020 · 15 comments
Closed

useCurrentLocation but it does not pop the address on default #21

newbieflutter opened this issue Mar 30, 2020 · 15 comments
Labels
question Further information is requested

Comments

@newbieflutter
Copy link

newbieflutter commented Mar 30, 2020

Hi,
I have tried to move the map to different location from the current pin location. Then at time I press the current location icon it goes fast and stick there. At time I got press few times before it returns there? Is there any settings to control it?

@fysoul17
Copy link
Owner

fysoul17 commented Mar 30, 2020

Hi, @newbieflutter
I'm sorry but I could not understand exactly what your issue is. I tried to move the pin around then pressed current location icon which leads me to the current location. Then everything was working correctly/intended.

Can you specify more detail about what exactly you want to achieve, please?

@newbieflutter
Copy link
Author

Hi,
Sorry maybe for the misunderstanding. Let me explain in detail.

  1. On default when the map is open it points to the current location.

  2. Then say I drag the pin to some where then it refresh and show the address there.

  3. Then I press the current location icon which suppose to lead to current location. Here I have intermittent problem. a) At times it does not go to the current location immediately I need to press few times I wonder is it some debounce settings some where? b) At times it leads to the current location. but then the address box is not updated it remains where it was before . I think some refresh settings.

  4. Can I off the top search box I mean disable it ? Cause I worried people will misuse and cost me money.

@fysoul17
Copy link
Owner

fysoul17 commented Apr 1, 2020

Hi, @newbieflutter

I followed your steps and the current location button was performing as intended (it goes immediately). I don't know why is the issue happening in your end.

There are two ways you can control about 'myLocationButton'.

  1. Change myLocationButtonCooldown time . It is set to 10 seconds as a default value, which means a user can press again after 10 seconds.
  2. Set enableMyLocationButton to false if you want to disable the button. ('enableMapTypeButton' for the map type change)

However, there is no feature for hiding autocomplete searching bar as it is one of the core function for the package.

Please let me know if there is a further issue.

@newbieflutter
Copy link
Author

Hi ,
Actually my side the issue was not always its intermittent. Let me try your suggestion then I will update you accordingly. What does the myLocationButtonCooldown is that is the refresh rate after the last click where it become active is it? So if I keep it to 5 seconds is that ok ? Another thing using the locator package only does it still need the google map api or its using the local install google map as the play store ?

@fysoul17
Copy link
Owner

fysoul17 commented Apr 2, 2020

@newbieflutter

  1. You can set 1 or 0 seconds to allow users to click my location button as much as they want. 5 seconds means user can only click the button once in 5 seconds.

  2. I am sorry but I don't get what you are asking regarding the locator package. Are you asking about the usage of locator package?

If so, the locator package is for:
a) Checking whether the location service is enabled.
b) Fetching current position using GPS

@newbieflutter
Copy link
Author

Hi,

  1. Ok I have set at 5 seconds seems to be better and its comes back to the current gps location well.

  2. Now I got this still at intermittent this issue say from the current location I drag to another location. Then I press the current location it goes to there immediately. But at times the address box below is not updated but at times its updated. At times the address stays where it was drag.

  3. My question was regarding geocode via your method is it being charge by google or its using the location google map to do the geocode?

@fysoul17
Copy link
Owner

fysoul17 commented Apr 4, 2020

@newbieflutter

  1. Good to hear it works as intended

  2. Have a look at debounce timer for updating result. There are two debounce timers for the result.
    a) autoCompleteDebounceInMilliseconds (defaults to 500ms)
    b) cameraMoveDebounceInMilliseconds (defaults to 750ms)
    I think you need to change the second option and see if it works as you want.

  3. Both. Whatever you use the google map service (Place API, Geo API or so), it all will be charged by google map API.

@newbieflutter
Copy link
Author

Hi,
1. cameraMoveDebounceInMilliseconds so should I increase or decrease it ? I guess decrease it right? Because at present before you mentioned to me the value is already I set at 500 ?

@fysoul17
Copy link
Owner

fysoul17 commented Apr 4, 2020

@newbieflutter

Okay, now I got what you are trying to achieve.

It only happens when 'my location button' zooms in. By default, the searching is not triggered when zoom has changed. This is because my primary goal is to reduce API usage as possible as I can, and thus I do not want a user to get search result when they only zoom in/out on the same place (position).

So, in order to achieve what you want, searching must be allowed even when a user tries to zoom in/out.

Therefore, I just added [forceSearchOnZoomChanged] option so that you can set to TRUE if you want my location button to trigger place search every time.

But please bear in mind that this will also consume searching API when a user just zoom in/out on the same position

Update to 0.9.1 version when it is up to pub

@newbieflutter
Copy link
Author

newbieflutter commented Apr 4, 2020

Hi,
I think thats is something is else. Nevermind I have tried to attached 3 pictures to help clear things.

  1. The first picture is the initial place where the current location is.(initial picture)

  2. I drag it to some else so the location change shoreline pear, mountain view, ca 94-43, usa.(moved picture)

  3. So next I pressed the current location button the icon moves but see the location stays at this shoreline pear, mountain view, ca 94-43, usa. Look at this image (pressedcurrentlocation button)

Hope I am more clearer and now easier to see the issue now.

initial
moved
pressedcurrentlocation button

@fysoul17
Copy link
Owner

fysoul17 commented Apr 4, 2020

Have you tried what I told you? I can see the zoom has been changed in your 2nd photo. That is the reason searching is not performing.

Please update to 0.9.1 and set ‘forceSearchOnZoomChanged’ to true. I am pretty sure it will work.

@newbieflutter
Copy link
Author

Hi,
Yes I have updated you can see. Unfortunately its the same though.

google_maps_place_picker:
    dependency: "direct main"
    description:
      name: google_maps_place_picker
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.9.1"

Here is my settings.

u```
sePlaceDetailSearch: false,
cameraMoveDebounceInMilliseconds:100,
autoCompleteDebounceInMilliseconds:100,
forceAndroidLocationManager: true,


@fysoul17
Copy link
Owner

fysoul17 commented Apr 4, 2020

where is forceSearchOnZoomChanged setting?

@newbieflutter
Copy link
Author

Hi,
I think looks like its working now I will further test on a real device and update accordingly.

@fysoul17
Copy link
Owner

fysoul17 commented Apr 9, 2020

Closing as the issue has been solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants