xcode - Google Maps SDK for iOS multiple markers swift code -
i want add multiple markers on map when start simulation second marker.
i following output:
2015-04-29 11:25:10.184 xxxxx[2332:41372] unable simultaneously satisfy constraints. @ least 1 of constraints in following list 1 don't want. try this: (1) @ each constraint , try figure out don't expect; (2) find code added unwanted constraint or constraints , fix it. (note: if you're seeing nsautoresizingmasklayoutconstraints don't understand, refer documentation uiview property translatesautoresizingmaskintoconstraints) ( "<nslayoutconstraint:0x7ff3a9d83610 gmsmapview:0x7ff3a9d12b60.leading == uiview:0x7ff3a9d6dff0.leadingmargin>", "<nslayoutconstraint:0x7ff3a9d83660 h:|-(0)-[gmsmapview:0x7ff3a9d12b60] (names: '|':uiview:0x7ff3a9d6dff0 )>" ) attempt recover breaking constraint <nslayoutconstraint:0x7ff3a9d83610 gmsmapview:0x7ff3a9d12b60.leading == uiview:0x7ff3a9d6dff0.leadingmargin>
make symbolic breakpoint @ uiviewalertforunsatisfiableconstraints catch in debugger. methods in uiconstraintbasedlayoutdebugging category on uiview listed in may helpful.
@iboutlet weak var mapview: gmsmapview! ///2 let locationmanager = cllocationmanager() override func viewdidload() { super.viewdidload() //3 locationmanager.delegate = self locationmanager.requestwheninuseauthorization() //markers var marker = gmsmarker() marker.position = cllocationcoordinate2dmake(xx.xxxxxx, x.xxxxx ) marker.title = "xxxx" marker.snippet = "xxxx" marker.infowindowanchor = cgpointmake(0.5, 0.5) marker.map = mapview var marker1 = gmsmarker() marker1.position = cllocationcoordinate2dmake(xx.xxxxxx, x.xxxxx ) marker1.title = "xxxx" marker1.snippet = "xxxx" marker1.infowindowanchor = cgpointmake(0.5, 0.5) marker1.map = mapview } // 1 func locationmanager(manager: cllocationmanager!, didchangeauthorizationstatus status: clauthorizationstatus) { // 2 if status == .authorizedwheninuse { // 3 locationmanager.startupdatinglocation() //4 mapview.mylocationenabled = true mapview.settings.mylocationbutton = true } } }
can me multiple markers swift code
thanks
Comments
Post a Comment