I am Mayank Diwakar, a Full-Stack Developer (particularly in Laravel & Flutter).
flutterbuddy1 / geocoder2 Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I wrote an app that uses google search places. My app used geocoder package to get coordinate of the address. I'm converting my app to use null safety so I am using Geocoder2.
I'm using the function call in the documentation:
fetchGeocoder = await Geocoder2.getCoordinatesFromAddress(
address: "277 Bedford Ave, Brooklyn, NY 11211, USA",
//address: city + "," + state,
googleMapApiKey: AppData().getAPIKey());
fetchGeocoder returns "Request Denied". I store the API key in a custom call. This is retrieved by AppData().getAPIKey().
I am sure the API key is correct because I use the AppData().getAPIKey() in the google place search function call.
Hello, my friend
I'm here to report an issue that I face while using the latest version geocoder2: ^1.1.0
of your library.
When trying to use the library, I got this issue
type 'Null' is not a subtype of type 'LocationType'
After reviewing Reverse Geocoding documentation and comparing it to a library, it turned out that there are only 3 types in the library, while there are 4 types mentioned in the documentation.
The missing type is "RANGE_INTERPOLATED".
I took the liberty of changing the code which was:
enum LocationType { ROOFTOP, GEOMETRIC_CENTER, APPROXIMATE }
final locationTypeValues = EnumValues({
"APPROXIMATE": LocationType.APPROXIMATE,
"GEOMETRIC_CENTER": LocationType.GEOMETRIC_CENTER,
"ROOFTOP": LocationType.ROOFTOP,
});
to the following:
enum LocationType { ROOFTOP, GEOMETRIC_CENTER, APPROXIMATE, RANGE_INTERPOLATED }
final locationTypeValues = EnumValues({
"APPROXIMATE": LocationType.APPROXIMATE,
"GEOMETRIC_CENTER": LocationType.GEOMETRIC_CENTER,
"ROOFTOP": LocationType.ROOFTOP,
"RANGE_INTERPOLATED": LocationType.RANGE_INTERPOLATED
});
After adding the missing type to locationTypeValues, the issue was FIXED.
I hope that cloud help fixing the issue.
I've been using it for a long time, but now it's not working and i got this message
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: No element
E/flutter (14161): #0 List.first (dart:core-patch/growable_array.dart:343:5)
E/flutter (14161): #1 Geocoder2.getDataFromCoordinates (package:geocoder2/src/geocoder2.dart:25:44)
E/flutter (14161):
E/flutter (14161): #2 MyApp.printdata (package:untitled/main.dart:12:20)
E/flutter (14161):
Hi!
I switched from geocoder to geocoder2 since geocoder didn't work anymore.
One of my previous tests that geocoded a point in the Indian Ocean now started to fail.
This worked better with geocoder then geocoder2 :-)
I can remove that test but I am just curious about if in general geocoder2 is worse than geocoder when it comes to such areas?
For this test below geocoder2 gives ...
formattedAddress: 6HH73GX2+X2
placeId: GhIJmZmZmZmZ8T8RAAAAAADARkA
... which to me is a bit cryptic.
// From coordinates
String? address = await geo.getAddress(LatLng(1.10, 45.50));
expect(address, 'Indian Ocean');
Any plans? :)
Sometimes I call getDataFromCoordinates() and I get results like state and city in the local language (with accents for instance and with the local names) and some times I get the result in English (no accents and the English names).
Thing is, my device language is English, but my location is different from any English speaking country. That is on purpose precisely to test for devices of people traveling.
Is there a way to set the language I want to use or maybe always use the language of the coordinates?
For example, Rome is Roma in Italian. I'm in that situation where some values are being stored in the db in one language (country=Roma) but the users can't find any result because their location is being returned in English (country=Rome) even though they are in Rome/Roma and they saved the place in the database using the same device.
It would be great to be able to get multiple addresses and not just the first match.
I'm happy to open a PR for this if this is something you think you'd be ok with including in this package?
Should be as easy as just re-writing the current function to return all matches and rename it and then have a function that with the original name that just grabs the first match from that new function
I'm trying to switch to your package but I'm not finding the correct syntax what's the equivalent of
`var addresses = await Geocoder.local.findAddressesFromQuery(loc);
var first = addresses.first;`
There are addressed in the world in which street number is not just a number, but contains letter as an index like '163A'. In this case, the plugin throws exception Invalid Double
. Example coordinates: lat: 42.6985489949584; lng: 23.298045694828033
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: No element
E/FrameEvents(15179): updateAcquireFence: Did not find frame.
E/flutter (15179): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: No element
E/flutter (15179): #0 List.first (dart:core-patch/growable_array.dart:343:5)
E/flutter (15179): #1 Geocoder2.getDataFromCoordinates (package:geocoder2/src/geocoder2.dart:25:44)
I want to migrate from geocoding package to geocoder2 but would like to know if it's compatible with open street map as I am not using Google map. Also is the map key required before using the package? I asked because OpenStreetMap doesn't require a key to work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.