mkpolyline

How to show Cluster for MKPolyline with geojson data View in iOS Swift

你说的曾经没有我的故事 提交于 2020-01-03 02:31:10
问题 I am loading Mapview with geojson data. It contains 7000 data in that geojson file. Even I loaded that data into Mapview . Its loaded fine, but, the problem is mapview getting freezing/stucking for few seconds while zoomin/zoomou So, its getting very bad user experience. Even, I loaded the data in background thread, still mapview getting freeze. After I read few forums, we can load clusters to avoid this kind freeze UI issue for mapview, but, I did not found for geojson data loading with

Adding multiple polylines to an MKMapView (Xamarin)

半世苍凉 提交于 2019-12-23 04:27:00
问题 I'm extending the example provided @ https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/maps/map-overlay/polyline/ to add multiple polylines to my map. Everything works fine with a single polyline, but when I add the second, or add a polyline alongside an annotation, GetOverlayRenderer errors out with the error "Value cannot be null.Parameter name: polyline" It's erring out on line: polylineRenderer = new MKPolylineRenderer (overlay as MKPolyline); And when I look at the

Two coloured/custom line on MKPolylineRenderer

可紊 提交于 2019-12-21 20:38:00
问题 I am drawing x amount of lines on an MKMapView . The data is being downloaded from a webservice and for each line that needs drawing I am creating a MKPolyline , adding it to an overlayArray (some overlays have more than one polyline) and finally adding that overlay to the map via: [self.mapView addOverlays:overlayArray];` The next function is therefore called which works wonderfully: - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay { if (![overlay

Plotting a users route taken on a map using MKPolyline

家住魔仙堡 提交于 2019-12-21 02:51:19
问题 I'm quite new to Objective-c. In my app, I'm trying to plot the users taken route onto a map. Here is what I have so far that just gets the users current location: #import "StartCycleViewController.h" #import "CrumbPath.h" @interface StartCycleViewController () @property (nonatomic, strong) CLLocationManager *locationManager; @property (nonatomic, strong) IBOutlet MKMapView *map; @property (nonatomic, strong) UIView *containerView; @end @implementation StartCycleViewController @synthesize

How to store an MKPolyline attribute as transformable in IOS coredata with swift?

给你一囗甜甜゛ 提交于 2019-12-19 06:04:14
问题 What would be the code required to allow the storage of an MKPolyline in CoreData in swift. So for example if I had one of my core data entities (say "myEntity") for which I wanted to save an MKPolyline, and have added the "polyline" field as transformable, and have set it to "transformable" in xcode. Also have produced NSManagedObject subclass. myEntity.swift import UIKit import CoreData import MapKit class myEntity: NSManagedObject { } myEntity+CoreDataProperties.swift import Foundation

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

MKRoute update MKPolyline Overlay when current Location changes

烈酒焚心 提交于 2019-12-10 08:59:13
问题 I did google a lot but couldn t get this to work. In my MKMapView I have a custom MKAnnotationView that I can place anywhere and also that dot that is representing my current location. I can do "show directions" calculate MKDirections between my custom annotation and my current position and draw a MKPolyline overlay to show the MKRoute. So far so good. If I am moving now towards my custom annotation, the Polyline Overlay does not update, does not substract the distance I already traveled. I

MKPolyline / MKPolylineRenderer changing color without remove it

那年仲夏 提交于 2019-12-08 23:53:46
问题 I working around with map app, I want to ask how to change the polyline color without remove and add it again, I found this topic https://stackoverflow.com/questions/24226290/mkpolylinerenderer-change-color-without-removing-overlay in stackoverflow but this is not involve with my question, I did not touch the line, so no need to do with -[MKMapViewDelegate mapView:didSelectAnnotationView:] So is it possible to do that? EDIT: What I want to do is change the polyline color smoothly (by shading

MKPolylineView initWithPolyLine: is deprecated in iOS 7

こ雲淡風輕ζ 提交于 2019-12-08 16:37:37
问题 I am getting the following error: initWithPolyline : is deprecated: first deprecated in iOS 7.0 MKPolylineView *lineView = [[MKPolylineView alloc] initWithPolyline:overlay]; What is the replacement method of instead of this ? 回答1: See the documentation for initWithPolyline: . Read the Deprecation Statement which says to use an MKPolylineRenderer object instead. 回答2: You should use (MKOverlayRenderer *) type delegate instead of (MKOverlayView *) type delegate. And return MKPolylineRenderer

Draw polyline in mapview iOS 6

﹥>﹥吖頭↗ 提交于 2019-12-08 05:45:37
问题 Hi I'm doing an app that must to show a map with the route. I parsed a Json to obtain the points to draw the polyline. I found a a code in the web to draw this polyline. The code I found it's on this link: http://iosguy.com/2012/05/22/tracing-routes-with-mapkit/ Where it says "Create the MKPolyline annotation" I tried to import this in my app, but I'm having problems to create the array of the coordinates. My method is this: - (void)createMKpolylineAnnotation { NSInteger numberOfSteps = self