@interface RMMapContents : NSObject
The cartographic and data components of a map. Do not retain.
There is exactly one RMMapContents instance for each RMMapView instance.
warning:Do not retain an RMMapContents instance. Instead, ask the RMMapView for its contents when you need it. It is an error for an RMMapContents instance to exist without a view, and if you retain the RMMapContents, it can’t go away when the RMMapView is released.
At some point, it’s likely that RMMapContents and RMMapView will be merged into one class.
- ( void )addTileSource:(id <RMTileSource>)newTileSource
添加叠加图层
newTileSource | {id RMTileSource} 地图服务,叠加图层 |
- ( void )addTileSource:(id<RMTileSource>)newTileSource atIndex:(NSUInteger)index
添加叠加图层
newTileSource | {id RMTileSource} 地图服务,叠加图层 |
index | {NSUInteger} 图层的索引值 |
- ( void )removeTileSource:(id <RMTileSource>)tileSource
移除叠加图层 底图不能被移除。
tileSource | {id RMTileSource} 地图服务,所移除的图层 |
- ( void )removeTileSourceAtIndex:(NSUInteger)index
移除叠加图层 底图不能被移除。
tileSource | {id RMTileSource} 地图服务,所需移除的图层 |
index | {NSUInteger} 图层的索引值 |
- ( void )setHidden:(BOOL)isHidden forTileSource:(id <RMTileSource>)tileSource
隐藏图层
tileSource | {id RMTileSource} 地图服务,所需隐藏的图层 |
- ( void )setHidden:(BOOL)isHidden forTileSourceAtIndex:(NSUInteger)index
隐藏图层
tileSource | {id RMTileSource} 地图服务,所需隐藏的图层 |
index | {NSUInteger} 图层的索引值 |
- ( void )setOpacity:(float)opacity forTileSource:(id <RMTileSource>)tileSource
设置图层的透明度
opacity | {float} 图层的透明度,其中在[0,1]区间内,默认为1,即不透明。 |
tileSource | {id RMTileSource} 地图服务,所设置透明度的图层 |
控制tileSource图层的可见性
layerID | {NSString} 图层在tileSource中的索引,如[1,2,3]-表示tileSource中的索引为1,2,3的图层可见 |
tileSource | {id RMTileSource} 需要控制的tileSource |
The cartographic and data components of a map.
@interface RMMapContents : NSObject
添加叠加图层
- ( void )addTileSource:(id <RMTileSource>)newTileSource
移除叠加图层 底图不能被移除。
- ( void )removeTileSource:(id <RMTileSource>)tileSource
隐藏图层
- ( void )setHidden:(BOOL)isHidden forTileSource:(id <RMTileSource>)tileSource
设置图层的透明度
- ( void )setOpacity:(float)opacity forTileSource:(id <RMTileSource>)tileSource
用于重置地图的中心点
- ( void )moveToProjectedPoint: (RMProjectedPoint)aPoint
将经纬度坐标转换为投影坐标
- ( RMProjectedPoint )latLongToProjectedPoint:(CLLocationCoordinate2D)latlong
将像素坐标转换为当前地图的地理坐标
- ( RMProjectedPoint )pixelToProjectedPoint:(CGPoint)aPixel
将投影坐标转换为经纬度坐标
- ( CLLocationCoordinate2D )projectedPointToLatLong:(RMProjectedPoint)projectedPoint
刷新瓦片地图
- ( void )refreshMap
返回包含整个屏幕的最小边界框
- ( RMSphericalTrapezium ) latitudeLongitudeBoundingBoxForScreen
删除tileSource缓存机制所缓存的所有图片。
-( void )removeAllCachedImages
@protocol RMTileSource <NSObject> @property ( nonatomic, assign ) RMTileImageSet * imagesOnScreen