Coder Social home page Coder Social logo

michael-m-aher / location_picker_flutter_map Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 44.0 287 KB

A Flutter package that provides Place search and Location picker for flutter maps with alot of cusomizations using Open Street Map.

License: MIT License

Kotlin 0.14% Swift 1.69% Objective-C 0.04% Dart 45.37% CMake 20.98% C++ 24.79% C 1.64% HTML 2.10% Ruby 3.24%
flutter flutter-map location location-picker location-services map open-street-map osm pub-dev location-picker-flutter

location_picker_flutter_map's Introduction

Linkedin Badge Website Badge Gmail Badge Facebook Badge Instagram Badge Whatsapp Badge CodeForces Badge Leetcode Badge HackerRank Badge Behance Badge

Glad to see you here! Β  Visitors

I'm a Student at Faculty of Computers and Artificial Intelligence πŸŽ“ Cairo University πŸ›. I'm a passionate learner who's always willing to learn and work across technologies and domains πŸ’‘. I love to explore new technologies and use them to solve real-life problems ✨. Apart from that I also love to guide and help beginners πŸ‘¨πŸ»β€πŸ’».
I'm currently into Mobile Development πŸ“±οΈ and working on my Data Structures and Algorithms πŸ€“.

Like My Work?

Buy Me A Coffee

Night Coding

My Absolute Favorites:

  • πŸ’» Β  I love exploring new tech stack and building cool stuffs.
  • πŸ“° Β  Reading tech blogs whenever possible.
  • πŸ• Β  Hackathons, meetups & tech events.

πŸ›  Β Tech Stack

CΒ  C++Β  C#Β  JAVAΒ  PythonΒ  DartΒ 
HTML CSSΒ  Bootstrap JavaScriptΒ  .NETΒ 
Flutter Node.jsΒ  NestJsΒ  DjangoΒ  FlaskΒ  TensorFlowΒ 
MySQLΒ  SQLiteΒ  PostgreSQLΒ  MongoDBΒ  FirebaseΒ  SupabaseΒ 
CMakeΒ  HerokuΒ  NetlifyΒ  DockerΒ  GitΒ  GitHubΒ  GitLabΒ 
PhotoshopΒ  IllustratorΒ  PremierePro

βš™οΈ Β GitHub Analytics

Show some ❀️ by starring some of the repositories!

location_picker_flutter_map's People

Contributors

dhafinrayhan avatar filipkrawiec avatar flajt avatar frieder-audriga avatar giorgio79 avatar lucazzp avatar mahmoos avatar michael-m-aher avatar sanat2002 avatar talamaska avatar

Stargazers

 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

location_picker_flutter_map's Issues

flutter_map dependency update

I'm currently blocked of using flutter_map 4 because of location_picker_flutter_map dependency conflict. Is it possible to update it?

fix location support while looking around

Thank you for the great package :)
I can't figure out how to change the behavior of the location marker. By default it is always centered on the screen but if you want to check out where this is and scroll around to see the surroundings then you also change the location which is not really what I want.
Is there a way to keep the marker where it is and only update it when the user taps on a point on the map? Similar to how google maps handles it when you click on a location.

Unhandled Exception: type '_TypeError' is not a subtype of type 'Exception'

When I press Set Current Location button, nothing happens and the error in the title is thrown.
The code piece that is shown when i click on the error is:

Widget _buildSelectButton() {
    return Positioned(
      top: widget.selectLocationButtonPositionTop,
      bottom: widget.selectLocationButtonPositionBottom,
      left: widget.selectLocationButtonPositionLeft,
      right: widget.selectLocationButtonPositionRight,
      child: Center(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: WideButton(
            widget.selectLocationButtonText,
            onPressed: () async {
              setState(() {
                isLoading = true;
              });
              pickData().then((value) {
                widget.onPicked(value);
              }, onError: (e) => onError(e)).whenComplete(() => setState(() {
                    isLoading = false;
                  }));
            },
            style: widget.selectLocationButtonStyle,
            textColor: widget.selectLocationTextColor,
            width: widget.selectLocationButtonWidth,
            height: widget.selectLocationButtonHeight,
          ),
        ),
      ),
    );
  }

Also the search bar does not work and presents the following error when I type anything.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type '_Map<String, dynamic>' is not a subtype of type 'List' in type cast

try {
                      String url =
                          'https://nominatim.openstreetmap.org/search?q=$value&format=json&polygon_geojson=1&addressdetails=1&accept-language=${widget.mapLanguage}';
                      var response = await client.post(Uri.parse(url));
                      var decodedResponse =
                          jsonDecode(utf8.decode(response.bodyBytes))
                              as List<dynamic>;
                      _options = decodedResponse
                          .map((e) => OSMdata(
                              displayname: e['display_name'],
                              latitude: double.parse(e['lat']),
                              longitude: double.parse(e['lon'])))
                          .toList();
                      setState(() {});
                    }

Ticker error

I got this error on the app
_FlutterLocationPickerState#f3c5a(tickers: tracking 1 ticker) was disposed with an active Ticker.
I also got a "stackTrace" error if I pop the screen when it is tracking location.

OpenStreetMap Attribution Guideline

Hi,

Thank you for your work. Does the package include an option to display OSM copyrights and respect the OpenStreetMap Attribution Guideline?

Thanks by advance.

How can I access onChange method?

Hi,

Thank you for your amazing efforts.
I'm facing a slight issue, when I remove the selectbutton, ( set showSelectLocationButton: false, ), the select button is gone, but there's no way to trigger onPicked method

Is there onChanged method or someway I can access the location?

Need a hint

Good time, please tell me how you can output the address, for example, only the city and the street with the house number?

Bug: Searchbar sometimes changes after result

Using version 3.0.1 of this library, tapping a search result in the search bar can sometimes result in a different result being displayed:

Example:

  • Type "Backwerk" in the search bar.
  • Choose the first result: "Backwerk 11, Hardenbergplatz, Charlottenburg, Charlottenburg-Wilmersdorf, Berlin, 10623, Germany"

Expected Behavior:

  • Animation of Map to that Location
  • Search bar reads "Backwerk 11, Hardenbergplatz, Charlottenburg, Charlottenburg-Wilmersdorf, Berlin, 10623, Germany"

Observed Behaviour:

  • Animation of Map to that Location
  • Search bar reads "Zoologischer Garten, Hardenbergstraße, C..."

This happens with different stores that are located in train stations or shopping centers too.

I think the root cause is that tapping the result will

  • Geocode the result into coordinates and trigger the map to move to that location
  • This triggers onLocationChanged, which then reverse-geocodes the coordinates back into an address (which can differ from the initial result because of inaccuracies).

So maybe if the result of the search that has been tapped can be re-used in onLocationChanged, this issue could be avoided.

Old version Intl dependency

Please upgrade Intl dependency to 0.18.0 It is not possible to upgrade other packages because this package needs Intl version 0.17.0

Feature Request: Customization of the search text field

I'm glad you have exposed various properties for search text field customization, I would really like to make more of what's exposed. I would like to change border radius, border with, border color. The best would be to expose the InputDecoration somehow. As minimum I would like borderRadius or inputBorder and inputFocusBorder.

Location / Latitude

Sometimes I get longitude value on latitude param, and viceversa. Is there a way to avoid this?

Thanks for this amazing plugin!

Address as a map vs. address as an object

The latest release introduces a problem with serializing addresses from the response of osm. As you may know, the address object may be different from one location to another, from one country to another. This is the data object for a location inside Italy:
{ hamlet: Pereto, village: Monte Cerignone, county: Pesaro e Urbino, ISO3166-2-lvl6: IT-PU, state: Marche, ISO3166-2-lvl4: IT-57, postcode: 61023, country: Italia, country_code: it }
And this is the data object for a location inside Ireland:
{ road: Clones Road, city_district: Drumcarn ED, region: Bailieborough-Cootehill Municipal District, county: County Cavan, ISO3166-2-lvl6: IE-CN, postcode: H12 E392, country: Γ‰ire / Ireland, country_code: ie }
As you can see they are not the same. And the properties serialized in the Address class will not cover all the info of an address. I suggest reverting it back to a map.

on 1.2.2 version

it's freezing the app when i pushed the button for picking the location on flutter web and I guess on Android the same

Initial map position before initPosition attribute

Hi, thanks for your work.
When the map opens, the displayed position is in Egypt before the initPosition attribute is applied. Can we change the starting position of the map? Thank you in advance for your feedback

Restrict selectable location to specified area

I need to restrict location allowed to be selected to specified area. So I need to:

  • draw my city border on map (geojson polygon)
  • throw message when selected location is outside city border

Is there any way to do that, or that functionality needs to be added? As I can see, there's some callback methods called on position change, so they could be used to check if current position is inside city border and possibly block selecting location outside the city, can I also draw anything I need on map (city border in this case).

Exception caught by image resource service

I keep getting this error when I try to open the map screen:
════════ Exception caught by image resource service ════════════════════════════
Exception: Buffer parameter must not be null
════════════════════════════════════════════════════════════════════════════════

Upgrade deps

I have created a #17 which upgrades the dependancies to the latest version.

Would be great for packages who also depend on flutter_map or some of the caching packages.

Bug Report importing the package regarding undefined Method

During the build process, I encountered the error:

Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.
../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_map_location_marker-8.0.5/lib/src/options/focal_point.dart:46:20: Error: The method 'scaleBy' isn't defined for the class 'Point<double>'.
 - 'Point' is from 'dart:math'.
Try correcting the name to the name of an existing method, or defining a method named 'scaleBy'.
      (size * 0.5).scaleBy(ratio) + offset;
                   ^^^^^^^
Target kernel_snapshot failed: Exception

Additional Information:

  • Flutter SDK version: '>=3.4.0 <4.0.0'
  • location_picker_flutter_map package version: ^3.0.1
  • Platform/Device: Android Emulator
  • Operating System: Windows

I did a workaround by doing:

  /// Projects the [FocalPoint] onto the map widget given its [size]. The
  /// resulting [Point] represents the absolute pixel coordinates on the map
  /// widget where the marker should be aligned.
  Point<double> project(Point<double> size) =>
  //    (size * 0.5).scaleBy(ratio) + offset; // removed this
  Point<double>(size.x * 0.5 * ratio.x, size.y * 0.5 * ratio.y) + offset; // added this

I'm not sure if I set it up correctly, but I followed all the steps accordingly. Is this a fault on my part? Thank you in advance.

flutter_map_cancellable_tile_provider recommendation despite it being installed

I recently upgraded to version 1.0.0 and since then I see these messages in the debug console:

flutter_map
js_primitives.dart:30 β”‚ πŸ’‘ Consider installing the official 'flutter_map_cancellable_tile_provider' plugin for improved
js_primitives.dart:30 β”‚ πŸ’‘ performance on the web.
js_primitives.dart:30 β”‚ πŸ’‘ See https://pub.dev/packages/flutter_map_cancellable_tile_provider for more info.

So I installed the package and rebuilt the app but I still get the recommendation.

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.