google maps - How to implement GMSMarker drag drop on GMSMapView? -


  1. i set marker on google map when drag it's of map drag.

  2. i want drag marker when click , drag on it's

  3. and drag map when click , drag outside marker.

this code

self.camera = [gmscameraposition camerawithlatitude:-33.86 longitude:151.20 zoom:6 bearing:0 viewingangle:0]; self.map = [gmsmapview mapwithframe:self.mapview.bounds camera:self.camera]; self.map.mylocationenabled = yes; self.map.delegate = self;  gmsmarker *marker = [[gmsmarker alloc] init]; marker.position = self.camera.target; marker.draggable = yes; marker.title = @"sydney"; marker.snippet = @"australia"; marker.map = self.map; marker.icon = [gmsmarker markerimagewithcolor:[uicolor bluecolor]]; marker.appearanimation = kgmsmarkeranimationpop;  [self.mapview addsubview:self.map]; 

and event on drag drop

- (void) mapview:(gmsmapview *)mapview didbegindraggingmarker:(gmsmarker *)marker {  }  - (void) mapview:(gmsmapview *)mapview didenddraggingmarker:(gmsmarker *)marker {  }  - (void) mapview:(gmsmapview *)mapview diddragmarker:(gmsmarker *)marker {  } 

when run app , debug above event not work. event click on marker work well.

how implement drag drop ?

you have press-and-hold on marker before begin dragging. thought wasn't working either until pointed out... needs in google's documentation.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -