GithubHelp home page GithubHelp logo

humazed / google_map_location_picker Goto Github PK

View Code? Open in Web Editor NEW
205.0 13.0 306.0 74.14 MB

๐ŸŒ Map location picker component for flutter Based on google_maps_flutter

License: Apache License 2.0

Kotlin 2.67% Swift 1.33% Objective-C 0.52% Dart 90.67% Ruby 4.81%

google_map_location_picker's Introduction

google_map_location_picker Pub

Location picker using the official google_maps_flutter.

I made This plugin because google deprecated Place Picker.

Demo

Using

Pubspec changes:

      dependencies: 
      
        google_maps_flutter: ^0.5.30
        google_map_location_picker: ^3.3.4
        flutter_localizations:
          sdk: flutter

For message localization inside the library please add in MaterialApp

import 'package:google_map_location_picker/generated/l10n.dart' as location_picker;
import 'package:flutter_localizations/flutter_localizations.dart';

MaterialApp(
  localizationsDelegates: const [
    location_picker.S.delegate,
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
    GlobalCupertinoLocalizations.delegate,
  ],
  supportedLocales: const <Locale>[
    Locale('en', ''),
    Locale('ar', ''),
  ],
  home: ...
)
import 'package:google_map_location_picker/google_map_location_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

LocationResult result = await showLocationPicker(context, apiKey);

Getting Started

Android

Specify your API key in the application manifest android/app/src/main/AndroidManifest.xml:

<manifest ...
  <application ...
    <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="YOUR KEY HERE"/>

iOS

Specify your API key in the application delegate ios/Runner/AppDelegate.m:

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "GoogleMaps/GoogleMaps.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GMSServices provideAPIKey:@"YOUR KEY HERE"];
  [GeneratedPluginRegistrant registerWithRegistry:self];
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end

Or in your swift code, specify your API key in the application delegate ios/Runner/AppDelegate.swift:

import UIKit
import Flutter
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("YOUR KEY HERE")
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

you need also to define NSLocationWhenInUseUsageDescription

  <key>NSLocationWhenInUseUsageDescription</key>
  <string>This app needs your location to test the location feature of the Google Maps location picker plugin.</string>

Note

The following permissions are not required to use Google Maps Android API v2, but are recommended.

android.permission.ACCESS_COARSE_LOCATION Allows the API to use WiFi or mobile cell data (or both) to determine the device's location. The API returns the location with an accuracy approximately equivalent to a city block.

android.permission.ACCESS_FINE_LOCATION Allows the API to determine as precise a location as possible from the available location providers, including the Global Positioning System (GPS) as well as WiFi and mobile cell data.


You must also explicitly declare that your app uses the android.hardware.location.network or android.hardware.location.gps hardware features if your app targets Android 5.0 (API level 21) or higher and uses the ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission in order to receive location updates from the network or a GPS, respectively.

<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false"  />

The following permissions are defined in the package manifest, and are automatically merged into your app's manifest at build time. You don't need to add them explicitly to your manifest:

android.permission.INTERNET Used by the API to download map tiles from Google Maps servers.

android.permission.ACCESS_NETWORK_STATE Allows the API to check the connection status in order to determine whether data can be downloaded.

Restricting Autocomplete Search to Region

The LocationResults returned can be restricted to certain countries by passing an array of country codes into the countries parameter of showLocationPicker(). Countries must be two character, ISO 3166-1 Alpha-2 compatible. You can find code information at Wikipedia: List of ISO 3166 country codes or the ISO Online Browsing Platform.

The example below restricts Autocomplete Search to the United Arab Emirates and Nigeria

showLocationPicker(
context, "YOUR API KEY HERE",
initialCenter: LatLng(31.1975844, 29.9598339),
myLocationButtonEnabled: true,
layersButtonEnabled: true,
countries: ['AE', 'NG'],
);

Credits

The google map from Flutter's google_maps_flutter package

current location and permission from BaseflowIT's flutter-geolocator package.

The search bar from Degreat's locationpicker package.

google_map_location_picker's People

Contributors

alfredjingle avatar amirh avatar billysutomo avatar furkankurt avatar fynntimes avatar humazed avatar janosroden avatar mariosemedo avatar mauriziopinotti avatar oguzozgen avatar pwiesinger avatar wooleah avatar zamorite avatar zeshuaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google_map_location_picker's Issues

google_map_location_picker_android.iml does not exist Please correct the file content

Cannot load settings from file 'C:\Users\Lenovo\Pictures\LocationPickerGoogle\google_map_location_picker\android\google_map_location_picker_android.iml': File C:\Users\Lenovo\Pictures\LocationPickerGoogle\google_map_location_picker\android\google_map_location_picker_android.iml does not exist Please correct the file content

This is whtat i get when i clone this project.. any help??

API Key not found

always throw this and showing a white screen, searching working fine but map not displayed
java.lang.RuntimeException: API key not found. Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml

I/flutter (15156): package:google_map_location_picker/src/map.dart 284:7 | GeolocationStatus.granted I/flutter (15156): package:google_map_location_picker/src/map.dart 60:7 | position = Lat: 29.9758073, Long: 31.0952241 I/flutter (15156): package:google_map_location_picker/src/map.dart 284:7 | GeolocationStatus.granted D/Dialog (15156): mIsSamsungBasicInteraction = false D/Dialog (15156): mIsSamsungBasicInteraction = false, isMetaDataInActivity = false I/Google Maps Android API(15156): Google Play services package version: 19629028 E/MethodChannel#flutter/platform_views(15156): Failed to handle method call E/MethodChannel#flutter/platform_views(15156): java.lang.RuntimeException: API key not found. Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml E/MethodChannel#flutter/platform_views(15156): at com.google.maps.api.android.lib6.drd.q.b(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-0):11) E/MethodChannel#flutter/platform_views(15156): at com.google.maps.api.android.lib6.auth.f.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-0):16) E/MethodChannel#flutter/platform_views(15156): at com.google.maps.api.android.lib6.impl.g.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-0):59) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.maps.internal.CreatorImpl.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-0):7) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.maps.internal.CreatorImpl.newMapViewDelegate(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-0):36) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.maps.internal.h.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-0):43) E/MethodChannel#flutter/platform_views(15156): at cl.onTransact(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (100400-0):5) E/MethodChannel#flutter/platform_views(15156): at android.os.Binder.transact(Binder.java:675) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.internal.maps.zza.zza(Unknown Source:10) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.maps.internal.zzf.zza(Unknown Source:19) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.maps.MapView$zzb.createDelegate(Unknown Source:13) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaa(Unknown Source:18) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(Unknown Source:22) E/MethodChannel#flutter/platform_views(15156): at com.google.android.gms.maps.MapView.onCreate(Unknown Source:26) E/MethodChannel#flutter/platform_views(15156): at io.flutter.plugins.googlemaps.GoogleMapController.init(GoogleMapController.java:136) E/MethodChannel#flutter/platform_views(15156): at io.flutter.plugins.googlemaps.GoogleMapBuilder.build(GoogleMapBuilder.java:32) E/MethodChannel#flutter/platform_views(15156): at io.flutter.plugins.googlemaps.GoogleMapFactory.create(GoogleMapFactory.java:51) E/MethodChannel#flutter/platform_views(15156): at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:154) E/MethodChannel#flutter/platform_views(15156): at android.app.Dialog.dispatchOnCreate(Dialog.java:550) E/MethodChannel#flutter/platform_views(15156): at android.app.Dialog.show(Dialog.java:391) E/MethodChannel#flutter/platform_views(15156): at android.app.Presentation.show(Presentation.java:267) E/MethodChannel#flutter/platform_views(15156): at io.flutter.plugin.platform.VirtualDisplayController.<init>(VirtualDisplayController.java:92) E/MethodChannel#flutter/platform_views(15156): at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:52) E/MethodChannel#flutter/platform_views(15156): at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:97) E/MethodChannel#flutter/platform_views(15156): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:87) E/MethodChannel#flutter/platform_views(15156): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:51) E/MethodChannel#flutter/platform_views(15156): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222) E/MethodChannel#flutter/platform_views(15156): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96) E/MethodChannel#flutter/platform_views(15156): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643) E/MethodChannel#flutter/platform_views(15156): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#flutter/platform_views(15156): at android.os.MessageQueue.next(MessageQueue.java:326) E/MethodChannel#flutter/platform_views(15156): at android.os.Looper.loop(Looper.java:181) E/MethodChannel#flutter/platform_views(15156): at android.app.ActivityThread.main(ActivityThread.java:7076) E/MethodChannel#flutter/platform_views(15156): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#flutter/platform_views(15156): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E/MethodChannel#flutter/platform_views(15156): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965) E/flutter (15156): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, API key not found. Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml, null) E/flutter (15156): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7) E/flutter (15156): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33) E/flutter (15156): <asynchronous suspension> E/flutter (15156): #2 AndroidViewController._create (package:flutter/src/services/platform_views.dart:639:54) E/flutter (15156): <asynchronous suspension> E/flutter (15156): #3 AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:556:14) E/flutter (15156): <asynchronous suspension> E/flutter (15156): #4 RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:189:29) E/flutter (15156): <asynchronous suspension> E/flutter (15156): #5 RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:170:5) E/flutter (15156): #6 RenderObject.layout (package:flutter/src/rendering/object.dart:1604:9) E/flutter (15156): #7 RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15) E/flutter (15156): #8 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7) E/flutter (15156): #9 RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:392:13) E/flutter (15156): #10 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7) E/flutter (15156): #11 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11) E/flutter (15156): #12 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:443:7) E/flutter (15156): #13 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7) E/flutter (15156): #14 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14) E/flutter (15156): #15 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7) E/flutter (15156): #16 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13) E/flutter (15156): #17 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7) E/flutter (15156): #18 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13) E/flutter (15156): #19 _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1214:11) E/flutter (15156): #20 RenderObject.layout (package:flutter/src/rendering/object.dart:1619:7) E/flutter (15156): #21 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11) E/flutter (15156): #22 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:443:7) E/flutter (15156): #23 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7) E/flutter (15156): #24 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14) E/flutter (15156): #25 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1496:7) E/flutter (15156): #26 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:765:18) E/flutter (15156): #27 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:346:19) E/flutter (15156): #28 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:701:13) E/flutter (15156): #29 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:285:5) E/flutter (15156): #30 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1016:15) E/flutter (15156): #31 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:958:9) E/flutter (15156): #32 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&Schedul I/flutter (15156): RangeError (index): Invalid value: Valid value range is empty: 0

Cannot install

I got this one in step of installing this package

`google_map_location_picker` does not specify a Swift version and none of the targets (`Runner`) integrating it have the
    `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that
    integrate this pod.

google_api_availability is not found ?

@humazed The plugin google_api_availability doesn't have a main class defined in E:\flutter_installation\flutter.pub-cache\hosted\pub.dartlang.org\google_api_availability-2.0.4\android\src\main\java\com\baseflow\googleapiavailability\GoogleApiAvailabilityPlugin.java or E:\flutter_installation\flutter.pub-cache\hosted\pub.dartlang.org\google_api_availability-2.0.4\android\src\main\kotlin\com\baseflow\googleapiavailability\GoogleApiAvailabilityPlugin.kt. This is likely to due to an incorrect androidPackage: com.baseflow.googleapiavailability or mainClass entry in the plugin's pubspec.yaml.
If you are the author of this plugin, fix the androidPackage entry or move the main class to any of locations used above. Otherwise, please contact the author of this plugin and consider using a different plugin in the meanwhile.

Camera position different from the current location

I am trying to edit an entity that has a pair of Latitude and Longitude, so i edit it through this widget. I want it to show in the map the old location and not my current location. I am setting the automaticallyAnimateToCurrentLocation: as false, but this centers the camera tu a remote island idkwhere. Is there a way to set the camera at a certain LatLng?

My code is the following:

Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RaisedButton(
onPressed: () async {
LocationResult result;
if (initialLat != 0 || initialLong != 0) {
result = await showLocationPicker(
context,
'AIzaSyD8_lvGEpZodiVIfNTBE5sOzgRfeVHpFe4',
initialCenter: LatLng(initialLat, initialLong),
myLocationButtonEnabled: true,
automaticallyAnimateToCurrentLocation: false,
);
} else {
result = await showLocationPicker(
context, 'AIzaSyD8_lvGEpZodiVIfNTBE5sOzgRfeVHpFe4',
myLocationButtonEnabled: true);
}
setState(() => _pickedLocation = result);
setLat(_pickedLocation.latLng.latitude);
setLong(_pickedLocation.latLng.longitude);
},
child: Text('Mark your location!'),
),
],
),
);

Thanks in advance!

Failed when i added latest version of intl

please update dependency of intl into latest version. i got error when i add google_map_location_picker and intl together. it says

Because every version of google_map_location_picker depends on flutter_localizations any from sdk which depends on intl 0.15.8, every version of google_map_location_picker requires intl 0.15.8.
So, because e_power_app depends on both google_map_location_picker ^2.1.1 and intl ^0.16.0, version solving failed.

Unnamed place issue

It's not fetching the location address or name. Instead, it keeps showing the unnamed location

Address not get

Hey,
I have implemented in my projects google map location picker.
It is working fine when I created it.

But some days to get error Unnamed Place.
Please tell me how to solve.

API Key not found

Target of URI doesn't exist: 'package:google_map_location_picker_example/keys.dart'.
Try creating the file referenced by the URI, or Try using a URI for a file that does exist.

Undefined name 'apiKey'.
Try correcting the name to one that is defined, or defining the name.

get result from resultCardConfirmWidget ?

how to do customize resultCardConfirmWidget and get the result?

LocationResult result = await showLocationPicker(
                      context,
                      'AIzaSyA53IJWp_0hr3adOC1byBFK6qf7-ConkQY',
                      automaticallyAnimateToCurrentLocation: true,
                      myLocationButtonEnabled: true,
                      layersButtonEnabled: true,
                      resultCardAlignment: Alignment.bottomCenter,
                      resultCardConfirmWidget: FloatingActionButton(
                        onPressed: () {
                          doSomething();
                        },
                        child: Icon(Icons.arrow_forward),
                      )
);

Pub get failed (1) intl version error

Because every version of google_map_location_picker depends on flutter_localizations any from sdk which depends on intl 0.16.0, every version of google_map_location_picker requires intl 0.16.0.
So, because project depends on google_map_location_picker ^2.0.0+0 which depends on intl ^0.15.8, version solving failed.
pub get failed (1)

No need to access GPS

Hi,
First thank you for the plugin.
One question: Why do you need the GPS enabled to pick a location?
I mean you don't need it unless you want to share your own position.
If my GPS is disabled, the plugin is not showing the map and I cannot pick a location, even through I want to share a position of something not related to my position at all.
Do you think you can change that? If there is already the button for "Showing my position", I think it is enough no?

Thank you

Feature request dark mode

Hi,

it would be awesome if you could also support dark mode in this package. I think it would be a minor thing to implement and really helpful.

Thanks for the great package!

Loding issue with IOS

Hi,

I am using version ^3.1.0. Its working fine in Android.
But giving issue with IOS. It stuck in loading.
The loading progress is never ending and nothing happens.

Please let me know what could be the issue.

Thanks,
Shanvaz.M

pickLocation() is not defined

When I try the following code:
LocationResult result = await LocationPicker.pickLocation(context, "My_API_Key");

it shows me an error saying the following:

the method 'pickLocation' isn't defined for the class 'LocationPicker'

has the function name been changed? or am I doing something wrong here?

Loading Progress never ending ios simulator

The loading progress is never ending and nothing happens, throwing this error.

_initCurrentLocation#e = PlatformException(ERROR_ALREADY_REQUESTING_PERMISSION, A request for permissions is already running, please wait for it to finish before doing another request., null)

Address issue

I got lat-lng . But i didn't got address. Address is null. Every time show unnamed road.

IOS Freezing issue

Hi, the iOS part in the example / custom project when you call the request the map won't load only the load circle going forever and when you press the searchbar the application will freeze.

Optionally disable automatic address lookup

Hi!

Firstly, just wanted to say this package is really awesome. Thanks for making it!

I was just wondering whether it would be possible to optionally switch off the automatic reverse geocoding each time the map is moved? Google Maps Geocoding API costs 5.00 USD per 1000 requests, so the costs could increase quite rapidly even with a small to medium-sized user base, since it's easy to fire off a large number of requests just by moving the map around.

I'll fork the repo for now so I can chuck something together for the project I'm working on. If you think this is a worthwhile feature, am happy to lend a hand with it.

Thanks!

error when instaling

log error :

Running "flutter pub get" in order_vendorApp...
Because restaurant_rlutter_ui depends on flutter_localizations any from sdk which depends on intl 0.15.8, intl 0.15.8 is required.

So, because restaurant_rlutter_ui depends on intl ^0.16.0, version solving failed.
pub get failed (1)
Process finished with exit code 1

my code:

version: 1.2.0

environment:
sdk: ">=2.1.0 <3.0.0"
module:
androidX: true
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter

The following adds the Cupertino Icons font to your application.

Use with the CupertinoIcons class for iOS style icons.

cupertino_icons: ^0.1.2
flutter_swiper: ^1.1.6
mvc_pattern: ^3.4.1
global_configuration: ^1.3.0
http: ^0.12.0+2
intl: ^0.16.0
html: ^0.14.0+2
shared_preferences: ^0.5.3+4
flutter_html: ^0.10.4
flutter_svg: ^0.14.2
location: ^2.3.5
dynamic_theme: ^1.0.0
flutter_inappbrowser: ^1.2.2
url_launcher: ^4.2.0+3
firebase_messaging: ^6.0.1
firebase_analytics: ^4.0.2
flare_flutter: ^1.8.1
liquid_swipe: '1.2.0'
google_map_location_picker: ^3.1.0

dev_dependencies:
flutter_test:
sdk: flutter

For information on the generic Dart part of this file, see the

following page: https://dart.dev/tools/pub/pubspec

The following section is specific to Flutter.

flutter:

The following line ensures that the Material Icons font is

included with your application, so that you can use the icons in

the material Icons class.

uses-material-design: true

AndroidX compitiblity

Hi,i must say excellent work, i tried your plugging with Flutter App, initially i am able to run app and perform desire operations,
but i tried it with androidX component, it will give me below error

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:preDebugBuild'.

Android dependency 'androidx.legacy:legacy-support-core-utils' has different version for the compile (1.0.0-rc01) and runtime (1.0.0) classpath. You should manually set the same version via DependencyResolution

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 5s


The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.


Finished with error: Gradle task assembleDebug failed with exit code 1

at this point i can't bypass androidX so is there any near solutions for it?

Unnamed place issue

I had to use this function to solve the issue.
Library always say "unnamed place" even when api keys are enabled.

import 'package:latlong/latlong.dart';
import 'package:geocoder/geocoder.dart';

static Future

getPredictionFromLatLng(LatLng latLng) async {
try {
final coordinates = new Coordinates(latLng.latitude, latLng.longitude);
List addresses =
await Geocoder.local.findAddressesFromCoordinates(coordinates);
Address first = addresses.first;
print("${first.featureName} : ${first.addressLine}");
return first;
} catch (e) {
return null;
}
}

City/Country

There is no good way of getting the city or country from the location result. Something on the way or have I missed something?

Location Address shows unamed Location

I have used the example to get the location but I have removed the localization. I am getting the Latitude and the Longitude but In place of the address of location It says unnamed location. Please either fix this or provide some solution.
It also throws range error as:
RangeError (index): Invalid value: Valid value range is empty: 0
I have tried looking at the files inside the google_maps_location_picker but I was unable to find anything.
Thank you in advance.

set value to initialCenter is not working

Hi,

Thank you for the wonderful library.

I want to use this library in one of my flutter project. I am able to use a location picker(add location) but I want to use the same picker to allow user to change location.
For that I tried to use it like below:

LatLng location = getLatLng(state.latLng);
result = await LocationPicker.pickLocation(
        context,
        Constants.GOOGLE_API_KEY,
        initialCenter: location,
);

but unfortunately its not pinned to specified location and always showing my current location.
How can I set the pinned location while initiating picker ?

Terminating app due to uncaught exception 'NSInvalidArgumentException'

trying to run on IOS but app is stuck on loader and getting error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull doubleValue]: unrecognized selector sent to instance 0x1f6d87c00'
*** First throw call stack:
(0x1bafc8a48 0x1baceffa4 0x1baecc5a8 0x1bafccaf4 0x1bafcea7c 0x108a04590 0x108a04468 0x108a05550 0x1068b442c 0x10684fdbc 0x1068a6654 0x10685d9e8 0x10686209c 0x1baf4703c 0x1baf46d78 0x1baf46448 0x1baf41584 0x1baf40adc 0x1c4ec6328 0x1bf03bae0 0x104fec624 0x1badca360)
libc++abi.dylib: terminating with uncaught exception of type NSException

Screen overlay detected blocks Android permissions

This issue was detected in the latest version of the plugin and it can be recreated in a fresh install of the app in Marshmallow devices. This cause the user to not enable the location permission and results in an overlay permission dialog

Execute a function after choosing the location from the map

I have the following code

LocationResult result = await showLocationPicker(context, "My_API_Key",
        initialCenter: LatLng(double.parse(latitude), double.parse(longitude)), myLocationButtonEnabled: true);

How can I execute a function after the user chooses the location and press the arrow button on the bottom right of the map??

`google map location picker` does not specify a Swift version

hello

i got this error when i'm trying to run the app

  • google_map_location_picker does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

I can't find location.

I just run the example app and I am getting these exceptions and can't get any location only Lat and Long.

I/flutter ( 3549): package:google_map_location_picker/src/map.dart 284:7 | GeolocationStatus.granted
I/flutter ( 3549): package:google_map_location_picker/src/map.dart 60:7 | position = Lat: ***, Long: ***
I/flutter ( 3549): package:google_map_location_picker/src/map.dart 284:7 | GeolocationStatus.granted
I/Google Maps Android API( 3549): Google Play services package version: 19420039
W/System  ( 3549): A resource failed to call release. 
I/flutter ( 3549): onCameraMoveStarted#_lastMapPosition = LatLng(45.521563, -122.677433)
I/flutter ( 3549): package:google_map_location_picker/src/map.dart 284:7 | GeolocationStatus.granted
I/flutter ( 3549): RangeError (index): Invalid value: Valid value range is empty: 0
I/flutter ( 3549): RangeError (index): Invalid value: Valid value range is empty: 0
I/flutter ( 3549): onCameraIdle#_lastMapPosition = LatLng(***, ***)
I/flutter ( 3549): package:google_map_location_picker/src/map.dart 284:7 | GeolocationStatus.granted
I/flutter ( 3549): RangeError (index): Invalid value: Valid value range is empty: 0

Screenshot_20191021-221135

IOS: Map not loading

the map won't load only the load circle going forever, only in real devices with ios 13 and 12. it is working fine in simulator and ios 10(iPhone 5) real devices.

following error: flutter pub get

From the email

We are trying to use in a project the google_map_location_picker
3.2.1+1 you created for flutter but when running flutter pub get after
adding the import in the pubspec, we get the following error: flutter
pub get
Because google_map_location_picker >=3.2.1+1 depends on provider
^4.0.4 and ParkNGo depends on provider 3.2.0,
google_map_location_picker >=3.2.1+1 is forbidden.
So, because ParkNGo depends on google_map_location_picker ^3.2.1+1,
version solving failed.
Running "flutter pub get" in pa-mobile...
pub get failed (1; So, because ParkNGo depends on
google_map_location_picker ^3.2.1+1, version solving failed.)

"Unnamed Place" issue

I'm getting the "unnamed place" issue, but only on android. I set my api key in the manifest per the guide, and it's working fine on iOS. It is not showing any map, and it is showing "Unnamed Place" in the address section on the bottom. I have all 5 of the needed APIs enabled on the Google API console. Also, no map is showing either. Here is what the screen looks like.

iOS: fatal error: 'google_map_location_picker/google_map_location_picker-Swift.h' file not found

Hi, I builded for iOS device and I got this error:
=== BUILD TARGET path_provider OF PROJECT Pods WITH CONFIGURATION Debug === /Users/wunu/workspace/flutter/.pub-cache/hosted/pub.flutter-io.cn/google_map_location_picker-2.1.0/ios/Classes/GoogleMapLocationPickerPlugin.m:2:9: fatal error: 'google_map_location_picker/google_map_location_picker-Swift.h' file not found #import <google_map_location_picker/google_map_location_picker-Swift.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.

version:
google_map_location_picker: 2.1.0

It is working fine on Android, please advise, thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.