mkmapview

Saving mapView.userLocation.location.coordinate.longitude into sqlite database

╄→尐↘猪︶ㄣ 提交于 2020-01-11 11:43:21
问题 I want to insert the value returning from mapView.userLocation.location.coordinate.longitude into my sqlite3 database. I am not sure of its type. I cannot do it this way: sqlite3_bind_text(stmt, 1, [mapView.userLocation.location.coordinate.longitude floatValue], -1, nil); It gives "Cannot convert to a pointer type" error because longitude is not float, I guess. The type of field is FLOAT in the database table. How can I convert the value of longitude to float from whatever it is? Thanks a lot

Which dataType will return the value (37.961498) as it is ? Double didn't work

試著忘記壹切 提交于 2020-01-11 08:03:52
问题 Which dataType will return the value (37.961498) as it is? I am working in MapView. Where, at present I am setting annotation and hence I have to set CLLocationCoordinate2DMake with some lat and lng parsed from googleAPI (Eg:lat = "37.9615000" and lng = "60.5566000") . I have the values in string, hence I converted the sting to double and then assigned But it didn't help. Please some one help me. double int1=[num1s floatValue]; double int2=[num2s floatValue]; NSLog(@" %f %f ",int1,int2);

Change Pin direction in iOS Map

 ̄綄美尐妖づ 提交于 2020-01-10 20:14:16
问题 SWIFT 3.0 MKMAPVIEW iOS Note : - (Integrated AppleMap ,Not working with GoogleMap ) I have done the following : Implemented map and Added custom Image to User Location Annotation When map open , it shows User Location at right Place My Requirement : When User Move into different direction staying at same place (or different place) the pin (at current location) should automatically point the direction in which user points. E.g : If Boat is showing at User Location position and its pointing

MKCircle is not updating radius but it's translating

一曲冷凌霜 提交于 2020-01-10 16:15:08
问题 I've to draw an MKCicle into an MKMapView. Then I've to re-draw it when user, through a slider, change the radius. I remove it and I re-create it, re-adding it to the map. But instead of do what I'm expecting, I see the MKCircle translating over the map, maintaining the same size. Here's my code: - (MKOverlayView *)mapView:(MKMapView *)map viewForOverlay:(id)overlay { MKOverlayView* overlayView = nil; if(overlay == self.circle) { //if we have not yet created an overlay view for this overlay,

MKCircle is not updating radius but it's translating

こ雲淡風輕ζ 提交于 2020-01-10 16:12:00
问题 I've to draw an MKCicle into an MKMapView. Then I've to re-draw it when user, through a slider, change the radius. I remove it and I re-create it, re-adding it to the map. But instead of do what I'm expecting, I see the MKCircle translating over the map, maintaining the same size. Here's my code: - (MKOverlayView *)mapView:(MKMapView *)map viewForOverlay:(id)overlay { MKOverlayView* overlayView = nil; if(overlay == self.circle) { //if we have not yet created an overlay view for this overlay,

Store data in MKAnnotation?

落爺英雄遲暮 提交于 2020-01-08 16:36:36
问题 So I'm pretty new to Xcode and Objective-C. I have several ArtPiece objects with various attributes stored in an array. I then add them as MKAnnotations to the mapview. What I need to be able to do is send a reference to the array position they came from on click. I believe MKAnnotations only have the data members title, image, and location, so when I make an MKAnnotation from the objects, the annotation does not keep any of the other attributes. So, my question is, how can I manage to keep a

Store data in MKAnnotation?

走远了吗. 提交于 2020-01-08 16:34:22
问题 So I'm pretty new to Xcode and Objective-C. I have several ArtPiece objects with various attributes stored in an array. I then add them as MKAnnotations to the mapview. What I need to be able to do is send a reference to the array position they came from on click. I believe MKAnnotations only have the data members title, image, and location, so when I make an MKAnnotation from the objects, the annotation does not keep any of the other attributes. So, my question is, how can I manage to keep a

User creating a box on MKMapView

半城伤御伤魂 提交于 2020-01-06 17:14:10
问题 I have an app that I want the user to be able to dray a box around a location, say a parking lot. I can't figure out a good way to let them draw this. I can track a long press, and draw the MKPolygon from the touch points, but I would like them to be able to trace the parking lot, and then get the coordinate values for the corners. I have no idea how to do this, and any help would be appreciated. 回答1: A slightly different and probably easier approach you can try is to let the user specify the

Change map pin (color or image)

孤街醉人 提交于 2020-01-06 08:27:30
问题 I know this is a question asked a lot. I have been reading through many of the questions on here regarding this for a while. I was hoping someone would have a simpler way using the code I have to replace the pins on my map with an image. I am still very new to objective c.The code I have is very short and easy. Most of what I have found online to post pins to a map is very long and drawn out. I have the following classes and controllers for my map view: LocationsViewController.h #import

Swift cannot assign subtitle in MKAnnotation

三世轮回 提交于 2020-01-06 03:41:04
问题 I'm attempting to programmatically update the subtitle within MKAnnotation . The following lines of code produce a cannot assign subtitle in annotation error: let annotation: MKAnnotation = mapView.annotations[0] as! MKAnnotation annotation.subtitle = nil Could anyone help lead me in a direction where I can update the subtitle after the MKAnnotation is shown within the map? 回答1: MKAnnotation is a protocol . In that protocol, subtitle is read-only. That means it cannot be set. So, because you