mkoverlay

Trouble with overlay using MKPolyline & MKPolylineView

流过昼夜 提交于 2019-12-12 10:09:47
问题 I have added an overlay to my MKMapView using the addOverlay: method. The overlay was made using MKPolyline and stroked using MKPolylineView. The stroke color is blue, with an alpha value of 0.7. When the view initially loads, the overlay is drawn correctly but the surrounding areas of the overlay are blue as well... When I pinch & zoom out, the blue area is still there but it adjusts to my new zoom level. This is somewhat hard to describe... but basically I have a small rectangle of "normal

How to Display offline map in iphone using Mapkit

和自甴很熟 提交于 2019-12-12 08:49:16
问题 How to Display offline map in iphone using mapkit? if i use static image then how do i get current location and pin drop on it? anyone has idea please suggest some solution. Thank you. 回答1: Try this post Force MapKit use cached map tiles only/disable network programmatically It tells about open source map OSM , helps offline map browsing. Source from here http://developers.cloudmade.com/projects/show/iphone-sdk. Hope this helps , or r u looking for some thing else. 回答2: Similar to What SDKs

Looking for an MKOverlayPathRenderer example

半腔热情 提交于 2019-12-12 08:46:41
问题 I am trying to figure out how to use a new MKOverlayPathRenderer class. In my app I previously used MKOverlayPathView when building with iOS 6 SDK, but it does not seem to work with iOS 7 SDK unfortunately. So I am trying to move my app from MKOverlayPathView to MKOverlayPathRenderer , but have no success so far. MKPolylineRenderer works OK, but MKOverlayPathRenderer does not. The code gets called, but no overlay is drawn on a map. Does anybody have a working example for MKOverlayPathRenderer

How to Design the Overlay Menu Above the Home Page?

[亡魂溺海] 提交于 2019-12-12 06:38:43
问题 How to Design the Overlay Instructions Above The View? I HAD 6 buttons....For Each Button I have To show Overlay For That, Before i click on that Button Suppose... 1) Click button is there...above the Click Button we need to show overlay for click on that button Like That... ** [I Need Like This Overlay menu over the all Buttons][1] [1]: http://i.stack.imgur.com/dIjRF.jpg ** 回答1: Use NSURLSession instead. NSURLConnection is deprecated. NSString *stringURL = [NSString stringWithFormat:@"%@

Objective-C add MKOverlay to map view animated fade in

我只是一个虾纸丫 提交于 2019-12-11 18:06:53
问题 I've been trying to add an MKOverlay to a map with animation. I'm trying to make it fade in when it's added and fade out when it's removed. Could this be done by created a custom overlay class or overlay view class? 回答1: On iOS 7 you could achieve this even with the new MKOverlayRenderer . It has an alpha property which you could animate by setting up a timer to repeatedly change its value and call setNeedsDisplayInMapRect:zoomScale: . 回答2: This is trickier in iOS 7 and above since the

Subclassing MKOVerlay View- canDrawMapRect not called

元气小坏坏 提交于 2019-12-11 05:30:03
问题 I am attempting to subclass MKOverlayView to create a custom overlay. I understand that in order to do this, one must override the following two methods - (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context; - (BOOL)canDrawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale; My question arrises from the latter method. For some reason, when I override it in my MKOverlayView subclass, it does not get called. According to documentation,

MKMapPointForCoordinate returning invalid coordinates

烂漫一生 提交于 2019-12-11 00:09:34
问题 I am working with MKMapView's, annotations, overlays, etc, but I'm having a pain in the butt issue with MKMapPointForCoordinate() returning an invalid coordinate. Code: MKMapPoint* pointArr; for (Category* route in validRoutes){ NSString* routeID = [route routeid]; NSArray* pointData = [routes objectForKey:routeID]; pointArr = malloc(sizeof(MKMapPoint) * [pointData count]); int i = 0; for (NSDictionary* routeData in pointData) { NSString* latitude = [routeData objectForKey:@"latitude"];

iOS 8 SDK, Swift, MapKit Drawing a Route

百般思念 提交于 2019-12-10 20:45:09
问题 I need to draw route between two points and I'm using MKDirectionsRequest for my purpose. Getting a route is OK, but I have trouble with drawing it. In iOS 8 SDK there's no function - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay There is only this one: func mapView(mapView: MKMapView!, rendererForOverlay overlay: MKOverlay!) -> MKOverlayRenderer! And for some reason, I can't understand why that method isn't called. Delegate for MapView is set and MapKit

swift remove map overlays

别说谁变了你拦得住时间么 提交于 2019-12-10 17:22:57
问题 I am trying to remove overlays from map. func removeMapOverlay() { var removeOverlays : [AnyObject]! = self.mapView.overlays // Above line throws runtime exception self.mapView.removeOverlays(removeOverlays) } self.mapView.overlays are type of AnyObject array. var overlays: [AnyObject]! { get } . So initially I wrote var removeOverlays = self.mapView.overlays It throws EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) exception at this line on runtime. So I did type casting for

MapKit Adding Raster Map via MKOverlay Weird Rendering Issue

╄→гoц情女王★ 提交于 2019-12-10 12:19:58
问题 I have added NOAA radar images to a weather app I have. I noticed that the image was not drawing correctly on the map after some testing. It seems the corners of the image were close to correct but when you move away from the corners it skews off. Below is the relevant code. Overlay: @implementation FMRadarOverlay - (id)initWithImage:(UIImage*)radarImage withLowerLeftCoordinate:(CLLocationCoordinate2D)lowerLeftCoordinate withUpperRightCoordinate:(CLLocationCoordinate2D)upperRightCoordinate{