From fa74cfd54955702ce2ea942e35d8585bf36c2c23 Mon Sep 17 00:00:00 2001 From: Leland Richardson Date: Sat, 23 Jan 2016 14:53:16 -0800 Subject: [PATCH] Fix showCallout bug for pin views on ios --- example/App.js | 28 ++++++------- example/examples/Callouts.js | 20 ++++++++- ios/AirMaps/AIRMapManager.m | 50 +++------------------- ios/AirMaps/AIRMapMarker.h | 2 + ios/AirMaps/AIRMapMarker.m | 69 ++++++++++++++++++++++++++++--- ios/AirMaps/AIRMapMarkerManager.m | 8 +--- 6 files changed, 105 insertions(+), 72 deletions(-) diff --git a/example/App.js b/example/App.js index f21432175..94ebfbf95 100644 --- a/example/App.js +++ b/example/App.js @@ -65,19 +65,19 @@ var App = React.createClass({ render() { - return this.renderExamples([ - [DisplayLatLng, 'Tracking Position'], - [ViewsAsMarkers, 'Arbitrary Views as Markers'], - [EventListener, 'Events'], - [MarkerTypes, 'Image Based Markers'], - [DraggableMarkers, 'Draggable Markers'], - [PolygonCreator, 'Polygon Creator'], - [AnimatedViews, 'Animating with MapViews'], - [AnimatedMarkers, 'Animated Marker Position'], - [Callouts, 'Custom Callouts'], - [Overlays, 'Circles, Polygons, and Polylines'], - [DefaultMarkers, 'Default Markers'], - ]); + //return this.renderExamples([ + // [DisplayLatLng, 'Tracking Position'], + // [ViewsAsMarkers, 'Arbitrary Views as Markers'], + // [EventListener, 'Events'], + // [MarkerTypes, 'Image Based Markers'], + // [DraggableMarkers, 'Draggable Markers'], + // [PolygonCreator, 'Polygon Creator'], + // [AnimatedViews, 'Animating with MapViews'], + // [AnimatedMarkers, 'Animated Marker Position'], + // [Callouts, 'Custom Callouts'], + // [Overlays, 'Circles, Polygons, and Polylines'], + // [DefaultMarkers, 'Default Markers'], + //]); //return ; //return ; //return ; @@ -85,7 +85,7 @@ var App = React.createClass({ //return ; //return ; //return ; - //return ; + return ; //return ; //return ; }, diff --git a/example/examples/Callouts.js b/example/examples/Callouts.js index 800fc3ede..d511aeeaa 100644 --- a/example/examples/Callouts.js +++ b/example/examples/Callouts.js @@ -54,6 +54,14 @@ var Callouts = React.createClass({ }; }, + show() { + this.refs.m1.showCallout(); + }, + + hide() { + this.refs.m1.hideCallout(); + }, + render() { const { region, markers } = this.state; return ( @@ -63,11 +71,12 @@ var Callouts = React.createClass({ initialRegion={region} > - + This is a plain view @@ -75,6 +84,7 @@ var Callouts = React.createClass({ Tap on markers to see different callouts + + + Show + + + Hide + + ); }, diff --git a/ios/AirMaps/AIRMapManager.m b/ios/AirMaps/AIRMapManager.m index 7dac3530a..b1020018c 100644 --- a/ios/AirMaps/AIRMapManager.m +++ b/ios/AirMaps/AIRMapManager.m @@ -210,55 +210,15 @@ - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id