1
我在地图上有一个滑块,我试图通过滑块进行放大。下面是我使用的代码,当+或 - 被击中的地图只显示蓝色(水)使用滑块缩放WKInterfaceMap(WKInterfaceSlider)
- (IBAction)sliderAction:(float)value {
RestaurantObject *restaurant = [nearbyMapArray objectAtIndex:0];
CLLocationCoordinate2D mapLocation = CLLocationCoordinate2DMake([restaurant.latitude doubleValue]*value, [restaurant.longitude doubleValue]*value);
MKCoordinateSpan coordinateSpan = MKCoordinateSpanMake(1, 1);
[self.map setRegion:(MKCoordinateRegionMake(mapLocation, coordinateSpan))];
}