CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/neilang/NAMapKit/v3.2.0/NAMapKit/NAPinAnnotation.m
accept-ranges: bytes
age: 0
date: Sun, 12 Oct 2025 02:21:52 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210031-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760235711.080073,VS0,VE1239
vary: Accept-Encoding
x-fastly-request-id: 0ecf14e3b4456fcf1c6b463fecb68ddfce6ba755
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"4380227d38fa4edd46d9552d113077f67c7cdd85e22aadd876a8db798785f161"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: 467A:132630:CE8B9:21F33C:68EB10BF
content-encoding: gzip
accept-ranges: bytes
date: Sun, 12 Oct 2025 02:21:52 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210020-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760235712.377409,VS0,VE314
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 6911a8c4dd182f41e3f046a63c23555fd9613a77
expires: Sun, 12 Oct 2025 02:26:52 GMT
source-age: 0
content-length: 619
//
// NAPinAnnotation.m
// NAMapKit
//
// Created by Neil Ang on 21/07/10.
// Copyright (c) 2010-14 neilang.com. All rights reserved.
//
#import "NAPinAnnotation.h"
#import "NAPinAnnotationView.h"
const CGFloat NAMapViewPinAnimationDuration = 0.5f;
@interface NAPinAnnotation ()
@property (nonatomic, readonly, weak) NAPinAnnotationView *view;
@end
@implementation NAPinAnnotation
- (id)initWithPoint:(CGPoint)point
{
self = [super initWithPoint:point];
if (self) {
self.color = NAPinColorRed;
self.title = nil;
self.subtitle = nil;
self.rightCalloutAccessoryView = nil;
}
return self;
}
- (UIView *)createViewOnMapView:(NAMapView *)mapView
{
return [[NAPinAnnotationView alloc] initWithAnnotation:self onMapView:mapView];
}
- (void)addToMapView:(NAMapView *)mapView animated:(BOOL)animate
{
[super addToMapView:mapView animated:animate];
if (animate) {
self.view.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, 0.0f, -self.view.center.y);
}
[mapView addSubview:self.view];
if (animate) {
self.view.animating = YES;
[UIView animateWithDuration:NAMapViewPinAnimationDuration animations:^{
self.view.transform = CGAffineTransformIdentity;
} completion:^ (BOOL finished) {
self.view.animating = NO;
}];
}
}
- (void)updatePosition
{
[self.view updatePosition];
}
@end