Tag: 地图框

在Mapbox iOS SDK上dynamic更改MGLPointAnnotation图像

我有一个应用程序在其iOS SDK上使用Mapbox的地图, Mapbox在其上显示标记( MGLPointAnnotation )。 我想在选中时更改标记的图像。 MGLPointAnnotation没有image属性,我试图调用委托方法mapView(mapView, imageForAnnotation annotation)但它没有工作。 任何想法我怎么能做到这一点? 谢谢!

Mapbox iOS8 Swift mapView.showUsersLocation

我试图使用Mapbox的iOS8 Swift cocoa插件mapbox和面临一个问题,当试图显示在mapView上的用户位置。 我的代码如下 func mapView(mapView: MGLMapView!, symbolNameForAnnotation annotation: MGLAnnotation!) -> String! { return "secondary_marker" } let manager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() let mapView = MGLMapView(frame: view.bounds, accessToken: "pk.privateMapboxAccessTokenGoesHere") mapView.autoresizingMask = .FlexibleWidth | .FlexibleHeight if CLLocationManager.authorizationStatus() == .NotDetermined { manager.requestAlwaysAuthorization() } mapView.showsUserLocation = true let x:MGLUserLocation = mapView.userLocation println(mapView.userLocation) println(x.coordinate.latitude) println(x.coordinate.longitude) … […]

使用MapBox Android SDK进行离线瓷砖caching

我有一个使用iOS瓷砖caching技术的工作iOS原型,如下所示(Objective-C代码): RMTileCache * tileCache = [[RMTileCache alloc] initWithExpiryPeriod:0]; [tileCache setBackgroundCacheDelegate:self]; RMMapboxSource * tileSource = [[RMMapboxSource alloc] initWithMapID:mapID]; [tileCache beginBackgroundCacheForTileSource:tileSource southWest:southWest northEast:northEasth minZoom:minZoom maxZoom:maxZoom]; 这基本上是做的是下载地图,永久caching瓷砖,使应用程序在未来离线运行的可能性。 由于我们正在通过正式的付费API,这当然不会违反任何法律限制。 现在我想在Android上实现相同的function。 我有Android Studio中运行的SDK和使用Map ID的远程地图的工作项目,基本上这(Android Eclipse布局XML): <com.mapbox.mapboxsdk.views.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" mapid=“my_map_id" /> 这工作正常,但解决scheme必须完全脱机,一旦caching完成。 我的问题是:在MapBox SDK中是否有上述iOS源代码的Java等价物? 我试图查看API,但无法find瓷砖caching系统的可靠参考。 经过一段痛苦的时间,试图根据方法名称和代码文档来运行,我放弃了。 我正在运行MapBox的最新GitHub发行版以及最新的Android Studio,一切正常,运行良好,但无法find完成此代码的代码。 我不一定需要一个API参考,几行代码显示如何完成就足够了。