I have been trying just about every tutorial I can find but I have no luck rendering the google map tiles behind the map in the view. I have double checked google console etc. But I have no luck
As you can see I can get the location to load up correctly, but the actual map behind it doesn't work at all. I have run out of ideas :(
try
check it on real device
double check that API Key of google maps correct and you enable google maps form google console
self.view = mapView in didLayoutSubView Method
Related
I'm trying to find a way to know if Streetview is available for a specific latitude and longitude before showing it to the user. This is my current code that correctly shows a Streetview if it's available or shows a black screen. I want to basically remove the black screen situation.
https://gist.github.com/speakerbug/33f267fd3a90dbd3ca07eae5b6c7c8f5
Not sure how to do it in Maps SDK for iOS, but you can check existence of panorama using Street View Image Metadata web service.
For example, the following web service request
https://maps.googleapis.com/maps/api/streetview/metadata?location=41.391073%2C2.180614&key=YOUR_API_KEY
will return
{
"copyright":"© Rodrigo Bastias",
"date":"2017-03",
"location":{
"lat":41.3910524,
"lng":2.1806449
}, "pano_id":"CAoSK0FGMVFpcE5OVHRRTERHX1lzRF93XzRZb2YyajJwaXFXUkFRQzg5THJuOTg.",
"status":"OK"
}
I want to show directions from my current location to an address in my app.
I can successfully open the directions by using:
Get directions
But once open I cannot return to my app. Is there a way to close the map again?
*note I appreciate this will only work correctly on iOS, I will handle android separately.
you should be able to do it with comgooglemaps-x-callback:
https://developers.google.com/maps/documentation/ios/urlscheme#specify_a_callback_url
this example opens Google Maps on iOS with a call back to chrome:
comgooglemapsurl://maps.google.com/maps?f=d&daddr=Tokyo+Tower,+Tokyo,+Japan&sll=35.6586,139.7454&sspn=0.2,0.1&nav=1&x-source=Chrome&x-success=googlechrome://?resume=true
Im calling google maps directions from my app and im leaving the saddr as directed by google so it will locate the user's location asthe starting point and give directions to the daddr specified.
The problem is....
The first time u use it and some other times.. Google maps doesnt locate well and give wrong directions asif you where located someplacr else. How can i keep this from happening ?????????
What i have tried is leaving the saddr and guide by google url scheme so google maps will autolocate the user starting point and give the directions to the destination point. Its got it completly wrong
I'm using the current version 1.1.2 of Google Maps SDK for iOS. The map only displays the Google logo, the current location and the added marker. But no map content whatsoever:
I correctly registered the API key:
BOOL result = [GMSServices provideAPIKey:#"<my key>"];
the result is YES and I verified that the bundleIdentifier matches with the API console. I load the GMSMapView from a storyboard and set the camera in my -viewDidLoad:
self.mapView.camera = [GMSCameraPosition cameraWithLatitude:0 longitude:0 zoom:2];
This is logged by GMSMapView:
Failed to make complete framebuffer object 8cd6
Failed to make complete framebuffer object 8cd6
Google Maps SDK for iOS version: 1.1.2.2533
GMSZoomTableQuadTree lacks root zoom table for tile type (mapType: 10)
GMSZoomTableQuadTree lacks root zoom table for tile type (mapType: 15)
Any idea what could cause this problem?
Found the solution myself.
I'm using Auto Layout. Apparently, in -viewDidLoad the Auto Layout hasn't yet done its work and my GMSMapView still had a CGRectZero frame. GMSMapView seems to react very picky on a zero frame.
[self.view layoutIfNeeded];
prior to setting the camera solved the problem for me.
This could also be caused by not having the right bundle ID entered under the API key in your Google API Console.
Just in case someone comes here and nothing works...
I was having this problem and got bored so I unzoomed the map and discovered I messed up with the location and my map center was in the middle of a desert!
Map was working just fine.
So try to unzoom, just in case.
If you have included both GoogleMaps.framework and GoogleMapsM4B.framework (Maps for Business) in your XCode project, remove GoogleMapsM4B.framework.
Otherwise you'll need to enable Google Maps Mobile SDK for Work through Enterprise Support portal instead of Google Maps SDK for iOS from Cloud Console.
I also had the same problem.The issue was I used two iOS Api keys in 2 different places in code.Please check whether you have used correct API Key (iOS Key) from google Api console.Use the same key through out your app.
I have a google map that I created with KML:
Here is a link to the map:
http://goo.gl/maps/dkfjU
Here is the complete KML file:
https://dl.dropbox.com/u/94943007/02bb39645a3c9d95afeed5cb9bd5d07c040d8ca8a4ee56b9fb367d38.kml
When browsing this map with my IPAD using safari, for some reason when I tap anywhere on the map, it creates a point there on the map.
How do I disable point creation on the map so that IPAD users are not able to do this?
I checked the link as well and Marcelo seems to be correct. To have a maps with the ability to turn on and off layers you will need to build your own site and perhaps use Javascript and the Google-maps API to build it. Maybe start here: https://developers.google.com/maps/documentation/javascript/tutorial
You cannot disable adding a place mark if you are browsing the map in safari
You can control it if you use map kit iOS API of the iOS SDK.
For importing KML-Data into that SDK, you can use Sample Code from
Apple:
http://developer.apple.com/library/ios/#samplecode/KMLViewer/Introduction/Intro.html
But there is no built-in KML Import in iOS SDK. You can use other
frameworks as mapbox/Simple-KML here
https://github.com/mapbox/Simple-KML
If you want to do this in safari, then you're lost, unless you can manipulate that using JavaScript!!!