-
Notifications
You must be signed in to change notification settings - Fork 133
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
Show Directions using Address query #57
Comments
@mattermoran I have the same requirement, Can you please provide an option to pass address(as string) or latitude-longitude for origin, destination, and waypoints. Because with the long-lat it shows different address names in the google maps. |
Hi @ben55j @DhavalRKansara map.showMarker(
coords: Coords(0, 0),
title: title,
zoom: zoom,
extraParams: {
'q': '200 Union St, San Francisco, CA 94133', // here just use an address it will override latlong
},
); Just tested on android seem to work. Haven't tried on ios but should be same Let me know if that helps |
@mattermoran This will work in the case of Do we have to manage |
Should also work for case MapType.google:
return Utils.buildUrl(
url: 'https://www.google.com/maps/dir/',
queryParams: {
'api': '1',
'destination': '${destination.latitude},${destination.longitude}',
'origin': Utils.nullOrValue(
origin,
'${origin?.latitude},${origin?.longitude}',
),
'waypoints': waypoints
?.map((coords) => '${coords.latitude},${coords.longitude}')
.join('|'),
'travelmode': Utils.enumToString(directionsMode),
...(extraParams ?? {}),
},
); As you can see the keys are Ideally, the plugin should support the address even if it only works in google maps I'll try to get to it when have time. |
Hello there! Thank you for developing this package! <3 I tested this "address without coordinates hack" on iOS and I can confirm that it works well for GoogleMaps app, but not for Apple Maps ("native" maps app for iPhones). To get the Apple Maps to open and show the address I wanted, I had to do this:
Note 1: before the map opens, I get an in-app browser which tries opening maps.apple.com
Looking forward to having a |
I would really like to have the ability to use My use case is, I need to query a location based off of the users current location. I would like to do this without having to supply the geolocation as that requires a permission I would rather not add, as I do not need it. I'm using this hack for Apple and Google right now, but it's certainly not ideal. Thank you for the great package! |
I need this to work in Apple Maps. Thank you @AleksandarSavic95 for the workaround.
When specifying final q = '$placeName, $streetAddress, $city';
if (map.mapType == MapType.apple) {
final url = ('https://maps.apple.com/?q=' + Uri.encodeQueryComponent(q));
if (!await url_launcher.canLaunch(url)) {
throw 'cannot not launch url $url';
}
/* await */ url_launcher.launch(url);
} else {
map.showMarker(
coords: Coords(0, 0),
title: meeting.placeName,
extraParams: {'q': q},
);
} |
This feature is planned for v3 and anything related to this will be tracked in #114 |
Hello,
Is there a possibility to use the showDirections function using an address query ? If no, are you planning to do it?.
Thank you,
Benjamin
The text was updated successfully, but these errors were encountered: