Image iPhone中的route me图像覆盖
我在项目中使用route me。图书馆很好。添加标记、绘制多边形效果良好。在给定位置(纬度、经度)放置单个图像作为覆盖怎么样?我想这个函数性缺失了。是否有人在不超载瓷砖源的情况下放置了图像覆盖?为什么不使用RMMarker?您可以将任何图像应用于它,并根据需要放置它。如果您想:Image iPhone中的route me图像覆盖,image,maps,overlay,tiles,route-me,Image,Maps,Overlay,Tiles,Route Me,我在项目中使用route me。图书馆很好。添加标记、绘制多边形效果良好。在给定位置(纬度、经度)放置单个图像作为覆盖怎么样?我想这个函数性缺失了。是否有人在不超载瓷砖源的情况下放置了图像覆盖?为什么不使用RMMarker?您可以将任何图像应用于它,并根据需要放置它。如果您想: UIImage *imgLocation = [UIImage imageWithContentsOfFile : [[NSBundle mainBundle] pat
UIImage *imgLocation = [UIImage imageWithContentsOfFile :
[[NSBundle mainBundle] pathForResource:@"location_ind"
ofType:@"png"]];
markerCurrentLocation = [[RMMarker alloc] initWithUIImage:imgLocation];
// make sure it is always above everything else.
markerCurrentLocation.zPosition = -1.0;
[mapView.markerManager addMarker:markerCurrentLocation
AtLatLong:startingPoint];
再见
--兰迪我找到了解决办法
CLLocationCoordinate2D lcA = CLLocationCoordinate2DMake(oSector.f_overlay_lat_min,oSector.f_overlay_long_min);
CLLocationCoordinate2D lcB = CLLocationCoordinate2DMake(oSector.f_overlay_lat_max,oSector.f_overlay_long_max);
CGPoint cgA = [mvMap latLongToPixel:lcA];
CGPoint cgB = [mvMap latLongToPixel:lcB];
float fLatMin = MIN(cgA.x,cgB.x);
float fLongMin = MIN(cgA.y,cgB.y);
float fWidth = sqrt((cgA.x - cgB.x)*(cgA.x - cgB.x));
float fHeight = sqrt((cgA.y - cgB.y)*(cgA.y - cgB.y));
RMMapLayer *mlLayer = [[RMMapLayer alloc] init];
mlLayer.contents = (id) oSector.im_overlay.CGImage;
mlLayer.frame = CGRectMake(fLatMin,fLongMin,fWidth,fHeight);
[[mvMap.contents overlay] addSublayer:mlLayer];
mvMap是您的h文件中某个地方的IBMOutlet RMMapView*mvMap
oSector.im_overlay.cg图像可以
UIImage *i = [UIImage imageNamed:<something>];
lmLayer.contents = i.CGImage
UIImage*i=[UIImage imagename:];
lmLayer.contents=i.CGImage