测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布最近发布 | 2017年5月 |
由Christian Greth维护。
依赖 | |
BlocksKit | >= 0 |
GoogleMaps | < 2.0.0 |
此 Pod 仅与 GoogleMaps < 2.0.0 兼容。已在 iOS 7 到 iOS 10.3 上进行了测试。
要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install
。
此 Pod 依赖于 GoogleMaps 框架以及 pod BlocksKit。
CHGMapViewScale 可通过 CocoaPods 使用。安装时,只需将以下行添加到 Podfile 中
pod "CHGMapViewScale"
使用刻度有两种不同的方式
// create a new scale for a specific GMSMapView
_mapViewScale = [[CHGMapViewScale alloc] initWithMapView:_mapView];
// customize the scale
_mapViewScale.scalePosition = CHGMapViewScalePositionTopRight;
_mapViewScale.topAdjustment = CGRectGetHeight(self.navigationController.navigationBar.bounds) + 30.f;
// update the scale
[_mapViewScale update];
// create a new CHGMapView based on GMSMapView. The scale is automatically available but invisible.
_mapView = [CHGMapView mapWithFrame:CGRectZero camera:camera];
self.view = _mapView;
_mapView.delegate = self;
// customize the scale
_mapView.scale.scalePosition = CHGMapViewScalePositionTopRight;
_mapView.scale.topAdjustment = CGRectGetHeight(self.navigationController.navigationBar.bounds) + 30.f;
// finally show the scale
[_mapView showScaleWithAutomaticUpdates:YES];
_mapView.scale.scaleUnit = CHGMapViewScaleUnitMiles;
_mapView.scale.scalePosition = CHGMapViewScalePositionTopRight;
_mapView.scale.topAdjustment = CGRectGetHeight(self.navigationController.navigationBar.bounds) + 30.f;
_mapView.scale.viewToScaleRation = 0.5f;
_mapView.scale.scaleColor = [UIColor blackColor];
_mapView.scale.scaleTextColor = [UIColor blackColor];
_mapView.scale.scaleTextAlignment = NSTextAlignmentRight;
Christian Greth,[email protected]
CHGMapViewScale 可在 MIT 许可证下使用。有关更多信息,请参阅 LICENSE 文件。