https://developers.google.com/maps/documentation/ios-sdk/utility/marker-clustering
我正在为地图聚类工作.在地图聚类中
private var mapView: GMSMapView!
Run Code Online (Sandbox Code Playgroud)
用于mapView但找不到任何GMSMapView!在故事板连接.
从故事板我发现
@IBOutlet var mapView: MKMapView!
Run Code Online (Sandbox Code Playgroud)
这就产生了问题.当我使用exampled谷歌地图时,它会抛出错误
这个类不是键值mapView的关键值编码兼容.
这里有完整的代码:
import UIKit
import MapKit
import GooglePlaces
import GoogleMaps
// Point of Interest Item which implements the GMUClusterItem protocol.
class POIItem: NSObject, GMUClusterItem {
var position: CLLocationCoordinate2D
var name: String!
init(position: CLLocationCoordinate2D, name: String) {
self.position = position
self.name = name
}
}
let kClusterItemCount = 10000
let kCameraLatitude = -33.8
let kCameraLongitude = 151.2
class FirstViewController: UIViewController , GMUClusterManagerDelegate,
GMSMapViewDelegate {
// @IBOutlet var mapView: …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 dingo 为 laravel 5.3 制作rest api。我在我的项目中设置了 dingo 并创建了一个像这样的 api 路由用于 test 。
$api->version('v1', function ($api) {
$api->get('hello',function (){
return "hello";
});
});
Run Code Online (Sandbox Code Playgroud)
但是当我运行 http://localhost:8000/api/hello时
然后
{
message: "Call to undefined method Illuminate\Routing\Route::getUri()",
code: 1,
status_code: 500,
debug: {
line: 98,
file: "C:\xampp\htdocs\apiTest\vendor\dingo\api\src\Routing\Adapter\Laravel.php",
class: "Symfony\Component\Debug\Exception\FatalErrorException",
trace: [
"#0 {main}"
]
}
}
Run Code Online (Sandbox Code Playgroud)
显示。
我已经搜索并找到了这个解决方案 Call to undefined method Illuminate\Routing\Route::get()
但是当我使用
use Illuminate\Support\Facades\Route;
Run Code Online (Sandbox Code Playgroud)
那么这个问题就显示出来了
FatalErrorException in Laravel.php line 116:
Call to undefined method Illuminate\Support\Facades\Route::where()
Run Code Online (Sandbox Code Playgroud)
这是 Laravel.php 文件
<?php
namespace Dingo\Api\Routing\Adapter;
use …Run Code Online (Sandbox Code Playgroud) dingo-api ×1
gmsmapview ×1
google-maps ×1
ios ×1
laravel ×1
mkmapview ×1
php ×1
rest ×1
swift ×1