Flutter: Is Google Map street view available in Flutter? - google-maps

Is Google Map street view available in Flutter? I know there is a plugin of Google Map but I couldn't find out if I can use Street view functionality.

I am the owner of flutter_google_street_view.
Flutter plugin flutter_google_street_view provides street view and support web, Android and iOS.
Try it! The usage steps shown below.
Usage Steps:
Get an API key at https://cloud.google.com/maps-platform/.
Specify your API key to your code.(Web, Android, iOS)
Create FlutterGoogleStreetView widget and the sample code show below.
StreetViewController? streetViewController;
FlutterGoogleStreetView(
initPos: LatLng(25.0780892, 121.5753234),
onStreetViewCreated: (StreetViewController controller) async {
//save controller for late using
streetViewController = controller;
//change position by controller
controller.setPosition(position: LatLng(37.769263, -122.450727))
}
)
Done and control FlutterGoogleStreetView by streetViewController.

Related

Issue with flutter and google maps widgets

I'm really novice in flutter and i encounter an issue with google maps widget. I tried to follow the tutorial of medium: https://medium.com/flutter-io/google-maps-and-flutter-cfb330f9a245
Unfortunately, when i'm running the app i have a blank image.
Screenshot of the app
Does somebody have ever encountered this problem ? Do you have a suggestion in which direction i can try to investigate?
Your API key is invalid. Or you haven't turned on Google Maps API.
The map feature showing up without maps is a clear question about your google map setup in Flutter. Make sure you have the following configurations.
Get an API Key at cloud.google.com/maps-platform/ and make sure to select the right map features you want. If you are not sure, select them all.
In Android:
Specify your API key in the application manifest android/app/src/main/AndroidManifest.xml:
Next: Go to Android manifest and insert the meta-data needed to attached your google maps account to the Flutter App.
Make sure you add your API-Key where it shows in the code.
<manifest ...
<application ...
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="YOUR KEY HERE"/>
Then: go into your iOS setting in ios/Runner/AppDelegate.m add add the required google codes.
#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
Additional information can be found within the Dart package here

Ionic 3 cordova native google maps

I am using the native Google Maps plugin in ionic and I am encountering a strange situation. Basically, I followed the example from the Ionic site. So when I start the app on androidn using ionic cordova run android this work fine. However, if I add --livereload, the map refuses the load. Actually, GoogleMaps.create() method returns an empty object {}. Anyone encountered this?
I am assuming that --livereload has a backend web server running that reloads the app which might cause the native plugin to fail?
Any insights?
For the livereload, insert setTimeout() before GoogleMaps.create().
Because when the app executed GoogleMaps.create(), platform.ready() is not ready.
loadMap() {
setTimeout(() => {
this.map = GoogleMaps.create('map_canvas');
}, 1000);
}

An internal error occurred in the Places API library

I'm working with GoogleMaps an GooglePlaces API but I always obtain de same error.
"The operation couldn’t be completed. An internal error occurred in the Places API library. If you believe this error represents a bug, please file a report using the instructions on our community and support page (https://developers.google.com/places/support)"
I've tried to run pod try GoogleMaps and when I launch de project any map is loaded, only a tableView with different options.
This is my code, I only want to obtain the user position:
-(IBAction)getCurrentPlace:(UIButton *)sender {
[placesClient currentPlaceWithCallback:^(GMSPlaceLikelihoodList *placeLikelihoodList, NSError *error){
if (error != nil) {
NSLog(#"Pick Place error %#", [error localizedDescription]);
return;
}
self.nameLabel.text = #"No current place";
self.addressLabel.text = #"";
if (placeLikelihoodList != nil) {
GMSPlace *place = [[[placeLikelihoodList likelihoods] firstObject] place];
if (place != nil) {
self.nameLabel.text = place.name;
self.addressLabel.text = [[place.formattedAddress componentsSeparatedByString:#", "]
componentsJoinedByString:#"\n"];
}
}
}];
}
I have imported mi APIKEY in didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[GMSServices provideAPIKey:#"MY_APIKEY"];
return YES;
}
And this is my Podfile
platform :ios, '7.0'
source 'https://github.com/CocoaPods/Specs.git'
target ‘googlePlace’ do
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Finally, my apikey is configured to iOS application in Google Console.
What's the problem??
This looks like your API key is either invalid or out of quota.
Can you check that you are passing the correct API key to GMSPlacesClient.provideAPIKey(_:).
If you are sure that you are passing the correct API key check the Google API Console (https://console.developers.google.com/) to ensure you have not run over your daily quota limit.
This issue can be tracked here: https://issuetracker.google.com/issues/35830792
Answer my own question
https://developers.google.com/places/migrate-to-v2?hl=es-419
This fixed the problem
Migrating to Google Places API for iOS, version 2
With the version 2 release of the Google Maps SDK for iOS, the Google Places API for iOS has been split from the Google Maps SDK for iOS and is now distributed as a seperate CocoaPod.
Take the following steps to update your existing apps:
Update your Podfile to reference the GooglePlaces CocoaPod in addition to the GoogleMaps CocoaPod. If you are not using the Google Maps SDK for iOS, you can remove GoogleMaps.
If you are using the place picker, update your Podfile to reference the GooglePlacePicker CocoaPod in addition to GooglePlaces.
Rename GoogleMaps to GooglePlaces in all imports where you are using the Places API.
Specify your API key using GMSPlacesClient.provideAPIKey(:) instead of GMSServices.provideAPIKey(:).
Get the required open source license text using GMSPlacesClient.openSourceLicenseInfo() as well as GMSServices.openSourceLicenseInfo() if you are using the Google Maps SDK for iOS or the Place Picker.
After doing 8 to 12 hours R&D Found below solution. I am sure it will work.
Just add the key in AppDelegate.swift file, not any other class. It will solve your problem.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
GMSPlacesClient.provideAPIKey("KEY")
GMSServices.provideAPIKey("KEY")
}
Note: It is compulsory to initialize GMSPlacesClient in AppDelegate Because it will take some time for initialization.
2018 answer, well in my new job, we're having a hard time about this. My own Places key works but not my new company's Places key. After a few hours, I remember the time when I was setting my own keys, I HAD TO REFRESH or REGENERATE NEW KEYS for the Places API before I got it to work. Now back to my current situation, I told this to my colleagues and boom, we just had to refresh the key, and it worked! :)

Get Segment/Polyline id from maps

Hi i try to find if the google maps or the HERE nokia maps have a static segmentation of the roads and an associated id and where i can find this information. I try to rich information by Rest api from both maps type but i don't find it. Instead with the javascript api i see that i can edit the maps or create, but what i want is to query a server or a database's maps in the way that i can use the latitude and longitude information as key for research (or the address string) and i will get the information from where is the location (so address or lat/long) and in what segment/polyline of the street the location is.
Thanks all!
I think you will need to look at a RESTful API rather than JavaScript:
For the HERE Platform:
To get an address for a Lat/Lng or vice-versa use the Geocoder API
To get an road shapes for a Lat/Lng use the Enterprise Routing API
You will need to register to get access to the documentation, but you can see the APIs in action using the API Explorer e.g. Geocoder Routing
The getlinkinfo endpoint of the Enterprise Routing API could be useful. For example, the URL below ( replace YOUR_APP_ID and YOUR_TOKEN of course)
http://route.st.nlp.nokia.com/routing/6.2/getlinkinfo.json?app_idYOUR_APP_ID&app_code=YOUR_APP_CODEg&waypoint=52.53086,13.3846&linkattributes=shape
Returns the following link info about a line segment:
{
"Response":
{
"MetaInfo":
{
"MapVersion":"2013Q2",
"ModuleVersion":"0.2",
"InterfaceVersion":"4.2",
"Timestamp":"2013-12-12T12:45:47.035Z"
},
"Link":[
{
"_type":"PrivateTransportLinkType",
"LinkId":"+931447247",
"Shape":[
"52.5309486,13.38447",
"52.5310516,13.38482"
],
"SpeedLimit":13.89,
"DynamicSpeedInfo":
{
"TrafficSpeed":6.94,
"TrafficTime":3.7,
"BaseSpeed":13.89,
"BaseTime":1.9
},
"Address":
{
"Label":"Invalidenstraße",
"Country":"DE",
"State":"Berlin",
"County":"Berlin",
"City":"Berlin",
"District":"Mitte",
"Street":"Invalidenstraße"
}
}
]
}
}

Google Map Version

Hi I am Using Google Map Version 2 in my asp.net web application. now my problem is the in map area GMAPEZ is displaying and nothing else and i have no error in my XML File with valid Google Map key. What could be the problem
You declare your map type as G_MAP_TYPE on line 766 of gmapez-2.js.
var mapType = G_MAP_TYPE;
You probably want to do one of the standard map types:
https://developers.google.com/maps/documentation/javascript/v2/introduction#CommonMapTypes
I found this in a few seconds using the Chrome Developer Tools. Here's a good reference so you can do the same:
http://www.youtube.com/watch?feature=player_embedded&v=nb4gvrNrDWw