TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | May 2017 |
Maintained by Christian Greth.
Depends on: | |
BlocksKit | >= 0 |
GoogleMaps | < 2.0.0 |
This pod will only work with GoogleMaps < 2.0.0. Tested on iOS 7 to iOS 10.3.
To run the example project, clone the repo, and run pod install
from the Example directory first.
This pod has dependencies to the GoogleMaps framework and the pod BlocksKit.
CHGMapViewScale is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CHGMapViewScale"
There are two different ways to use the scale:
// 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 is available under the MIT license. See the LICENSE file for more info.