Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed animatesDrop for MKPinAnnotationView #38

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/DemoApp/Classes/DemoAppApplicationDelegate.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MapKit.h>
#import "MapKit.h"

@class MKMapView;

Expand Down
2 changes: 1 addition & 1 deletion Source/DemoApp/Classes/DemoAppApplicationDelegate.m
Expand Up @@ -8,7 +8,7 @@

#import "DemoAppApplicationDelegate.h"
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import "MapKit.h"

@implementation DemoAppApplicationDelegate

Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKAnnotationView.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKView.h>
#import "MKView.h"
#import <WebKit/WebKit.h>

enum {
Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKAnnotationView.m
Expand Up @@ -7,7 +7,7 @@
//

#import "MKAnnotationView.h"
#import <MapKit/MKAnnotation.h>
#import "MKAnnotation.h"



Expand Down
6 changes: 3 additions & 3 deletions Source/Framework/Classes/MKCircle.h
Expand Up @@ -8,9 +8,9 @@

#import <Cocoa/Cocoa.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MKShape.h>
#import <MapKit/MKOverlay.h>
#import <MapKit/MKGeometry.h>
#import "MKShape.h"
#import "MKOverlay.h"
#import "MKGeometry.h"

@interface MKCircle : MKShape <MKOverlay> {
@package
Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKCircleView.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKOverlayPathView.h>
#import "MKOverlayPathView.h"

@class MKCircle;

Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKCircleView.m
Expand Up @@ -7,7 +7,7 @@
//

#import "MKCircleView.h"
#import <MapKit/MKCircle.h>
#import "MKCircle.h"

@implementation MKCircleView

Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKGeocoder.h
Expand Up @@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import <CoreLocation/CLLocation.h>
#import <WebKit/WebKit.h>
#import <MapKit/MKTypes.h>
#import "MKTypes.h"

@protocol MKGeocoderDelegate;

Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKMapView+Additions.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKMapView.h>
#import "MKMapView.h"

@interface MKMapView (Additions)

Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKMapView+DelegateWrappers.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKMapView.h>
#import "MKMapView.h"

@interface MKMapView (DelegateWrappers)

Expand Down
8 changes: 4 additions & 4 deletions Source/Framework/Classes/MKMapView+Private.m
Expand Up @@ -34,14 +34,14 @@ - (void)customInit

// Create the overlay data structures
overlays = [[NSMutableArray array] retain];
overlayViews = [[NSMapTable mapTableWithStrongToStrongObjects] retain];
overlayScriptObjects = [[NSMapTable mapTableWithStrongToStrongObjects] retain];
overlayViews = [[NSMapTable strongToStrongObjectsMapTable] retain];
overlayScriptObjects = [[NSMapTable strongToStrongObjectsMapTable] retain];

// Create the annotation data structures
annotations = [[NSMutableArray array] retain];
selectedAnnotations = [[NSMutableArray array] retain];
annotationViews = [[NSMapTable mapTableWithStrongToStrongObjects] retain];
annotationScriptObjects = [[NSMapTable mapTableWithStrongToStrongObjects] retain];
annotationViews = [[NSMapTable strongToStrongObjectsMapTable] retain];
annotationScriptObjects = [[NSMapTable strongToStrongObjectsMapTable] retain];

[self loadMapKitHtml];

Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKMapView+WebViewIntegration.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKMapView.h>
#import "MKMapView.h"

@interface MKMapView (WebViewIntegration)

Expand Down
8 changes: 4 additions & 4 deletions Source/Framework/Classes/MKMapView.h
Expand Up @@ -9,10 +9,10 @@
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MKTypes.h>
#import <MapKit/MKGeometry.h>
#import <MapKit/MKOverlay.h>
#import <MapKit/MKAnnotationView.h>
#import "MKTypes.h"
#import "MKGeometry.h"
#import "MKOverlay.h"
#import "MKAnnotationView.h"

@protocol MKMapViewDelegate;
@class MKUserLocation;
Expand Down
18 changes: 10 additions & 8 deletions Source/Framework/Classes/MKMapView.m
Expand Up @@ -9,14 +9,14 @@
#import "MKMapView.h"
#import "MKMapView+Private.h"
#import "JSON.h"
#import <MapKit/MKUserLocation.h>
#import "MKUserLocation.h"
#import "MKUserLocation+Private.h"
#import <MapKit/MKCircleView.h>
#import <MapKit/MKCircle.h>
#import <MapKit/MKPolyline.h>
#import <MapKit/MKPolygon.h>
#import <MapKit/MKAnnotationView.h>
#import <MapKit/MKPointAnnotation.h>
#import "MKCircleView.h"
#import "MKCircle.h"
#import "MKPolyline.h"
#import "MKPolygon.h"
#import "MKAnnotationView.h"
#import "MKPointAnnotation.h"
#import "MKMapView+DelegateWrappers.h"
#import "MKMapView+WebViewIntegration.h"
#import "MKWebView.h"
Expand Down Expand Up @@ -60,7 +60,6 @@ - (void)dealloc
[webView setFrameLoadDelegate:nil];
delegate = nil;
[webView removeFromSuperview];
[webView autorelease];
[locationManager stopUpdatingLocation];
[locationManager release];
[userLocation release];
Expand Down Expand Up @@ -136,6 +135,9 @@ - (MKCoordinateRegion)region
{
WebScriptObject *webScriptObject = [webView windowScriptObject];
NSString *json = [webScriptObject evaluateWebScript:@"getRegion()"];
if (![json isKindOfClass:[NSString class]]) {
return MKCoordinateRegionMake(CLLocationCoordinate2DMake(0, 0), MKCoordinateSpanMake(0, 0));
}
NSDictionary *regionDict = [json JSONValue];

NSNumber *centerLatitude = [regionDict valueForKeyPath:@"center.latitude"];
Expand Down
6 changes: 3 additions & 3 deletions Source/Framework/Classes/MKMultiPoint.h
Expand Up @@ -7,9 +7,9 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKShape.h>
#import <MapKit/MKGeometry.h>
#import <MapKit/MKTypes.h>
#import "MKShape.h"
#import "MKGeometry.h"
#import "MKTypes.h"

@interface MKMultiPoint : MKShape {
CLLocationCoordinate2D *coordinates;
Expand Down
6 changes: 3 additions & 3 deletions Source/Framework/Classes/MKOverlay.h
Expand Up @@ -7,9 +7,9 @@
*
*/

#import <MapKit/MKAnnotation.h>
#import <MapKit/MKTypes.h>
#import <MapKit/MKGeometry.h>
#import "MKAnnotation.h"
#import "MKTypes.h"
#import "MKGeometry.h"


@protocol MKOverlay <MKAnnotation>
Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKOverlayPathView.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKOverlayView.h>
#import "MKOverlayView.h"

@interface MKOverlayPathView : MKOverlayView {
NSColor *fillColor;
Expand Down
4 changes: 2 additions & 2 deletions Source/Framework/Classes/MKOverlayView.h
Expand Up @@ -7,8 +7,8 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKOverlay.h>
#import <MapKit/MKView.h>
#import "MKOverlay.h"
#import "MKView.h"

@interface MKOverlayView : MKView {
id <MKOverlay> overlay;
Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKPinAnnotationView.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKAnnotationView.h>
#import "MKAnnotationView.h"

enum {
MKPinAnnotationColorRed = 0,
Expand Down
9 changes: 9 additions & 0 deletions Source/Framework/Classes/MKPinAnnotationView.m
Expand Up @@ -46,4 +46,13 @@ - (NSString *)imageUrl
return [url absoluteString];
}


- (NSDictionary *)options {
NSMutableDictionary* mutableOptions = [[super options] mutableCopy];

[mutableOptions setObject:[NSNumber numberWithBool:animatesDrop] forKey:@"dropAnimation"];

return [[mutableOptions copy] autorelease];
}

@end
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKPlacemark+Private.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKPlacemark.h>
#import "MKPlacemark.h"

@interface MKPlacemark (Private)

Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKPlacemark.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKAnnotation.h>
#import "MKAnnotation.h"
#import <CoreLocation/CLLocation.h>

@interface MKPlacemark : NSObject <MKAnnotation> {
Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKPointAnnotation.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKShape.h>
#import "MKShape.h"
#import <CoreLocation/CLLocation.h>

@interface MKPointAnnotation : MKShape {
Expand Down
4 changes: 2 additions & 2 deletions Source/Framework/Classes/MKPolygon.h
Expand Up @@ -7,8 +7,8 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKMultiPoint.h>
#import <MapKit/MKOverlay.h>
#import "MKMultiPoint.h"
#import "MKOverlay.h"

@interface MKPolygon : MKMultiPoint <MKOverlay> {
NSArray *interiorPolygons;
Expand Down
4 changes: 2 additions & 2 deletions Source/Framework/Classes/MKPolygonView.h
Expand Up @@ -7,8 +7,8 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKPolygon.h>
#import <MapKit/MKOverlayPathView.h>
#import "MKPolygon.h"
#import "MKOverlayPathView.h"

@interface MKPolygonView : MKOverlayPathView{
NSArray *path;
Expand Down
4 changes: 2 additions & 2 deletions Source/Framework/Classes/MKPolyline.h
Expand Up @@ -7,8 +7,8 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKMultiPoint.h>
#import <MapKit/MKOverlay.h>
#import "MKMultiPoint.h"
#import "MKOverlay.h"

@interface MKPolyline : MKMultiPoint <MKOverlay>

Expand Down
4 changes: 2 additions & 2 deletions Source/Framework/Classes/MKPolylineView.h
Expand Up @@ -7,8 +7,8 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKPolyline.h>
#import <MapKit/MKOverlayPathView.h>
#import "MKPolyline.h"
#import "MKOverlayPathView.h"

@interface MKPolylineView : MKOverlayPathView {
NSArray *path;
Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKReverseGeocoder.h
Expand Up @@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import <CoreLocation/CLLocation.h>
#import <WebKit/WebKit.h>
#import <MapKit/MKTypes.h>
#import "MKTypes.h"

@class MKPlacemark;
@protocol MKReverseGeocoderDelegate;
Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKShape.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKAnnotation.h>
#import "MKAnnotation.h"

@interface MKShape : NSObject <MKAnnotation> {
@package
Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKUserLocation+Private.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKUserLocation.h>
#import "MKUserLocation.h"

@class CLLocation;

Expand Down
2 changes: 1 addition & 1 deletion Source/Framework/Classes/MKUserLocation.h
Expand Up @@ -7,7 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <MapKit/MKAnnotation.h>
#import "MKAnnotation.h"

@class CLLocation;

Expand Down