Commit b5aee91b authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent 99dad828
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1150" LastUpgradeVersion = "1150"
version = "1.3"> version = "1.7">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"> buildImplicitDependencies = "YES">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
debugServiceExtension = "internal" debugServiceExtension = "internal"
allowLocationSimulation = "YES"> allowLocationSimulation = "NO">
<BuildableProductRunnable <BuildableProductRunnable
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
...@@ -50,6 +50,10 @@ ...@@ -50,6 +50,10 @@
ReferencedContainer = "container:ZhiJi.xcodeproj"> ReferencedContainer = "container:ZhiJi.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<LocationScenarioReference
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
referenceType = "1">
</LocationScenarioReference>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release" buildConfiguration = "Release"
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "ZJBaseMapViewController.h" #import "ZJBaseMapViewController.h"
#import <GoogleMaps/GoogleMaps.h> #import <GoogleMaps/GoogleMaps.h>
#import "ZJLocationManager.h"
@interface ZJBaseMapViewController ()<MAMapViewDelegate, XMPopupListViewDelegate, GMSMapViewDelegate> @interface ZJBaseMapViewController ()<MAMapViewDelegate, XMPopupListViewDelegate, GMSMapViewDelegate>
...@@ -20,7 +21,11 @@ ...@@ -20,7 +21,11 @@
@property (nonatomic, strong) ZJMapCardFriendSelectView *selectView; @property (nonatomic, strong) ZJMapCardFriendSelectView *selectView;
@property (nonatomic, strong) ZJFriendModel *selectFriendModel; @property (nonatomic, strong) ZJFriendModel *selectFriendModel;
@property (nonatomic, strong) GMSMapView *mapView; @property (nonatomic, strong) GMSMapView * mapView;
@property (nonatomic, strong) GMSMarker * selfMarker;
@property (nonatomic, assign) float zoom;
@property (nonatomic, assign) BOOL refershMyself;
@end @end
...@@ -43,6 +48,19 @@ ...@@ -43,6 +48,19 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self getFriendList]; // [self getFriendList];
}); });
self.refershMyself = YES;
[[ZJLocationManager shared] initWithLocationUpdateInfo:^(ZJLocationModel * model, CLLocation * location) {
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(model.latitude, model.longitude);
if (self.refershMyself) {
self.mapView.camera = [GMSCameraPosition cameraWithTarget:coord zoom:self.zoom];
self.refershMyself = NO;
}
[self setPoint:coord target:1];
}];
} }
- (void)viewWillAppear:(BOOL)animated{ - (void)viewWillAppear:(BOOL)animated{
...@@ -54,6 +72,8 @@ ...@@ -54,6 +72,8 @@
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.868 longitude:151.2086 zoom:12]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.868 longitude:151.2086 zoom:12];
_zoom = 14;
///初始化地图 ///初始化地图
// self.mapView = [[MAMapView alloc] initWithFrame:self.view.bounds]; // self.mapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
self.mapView = [GMSMapView mapWithFrame:self.view.bounds camera:camera]; self.mapView = [GMSMapView mapWithFrame:self.view.bounds camera:camera];
...@@ -72,7 +92,7 @@ ...@@ -72,7 +92,7 @@
// [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)]; // [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)];
// } // }
// _mapView.delegate = self; _mapView.delegate = self;
// _mapView.zoomLevel = 14; // _mapView.zoomLevel = 14;
// _mapView.showsScale = false; // _mapView.showsScale = false;
// _mapView.showsCompass = false; // _mapView.showsCompass = false;
...@@ -132,11 +152,29 @@ ...@@ -132,11 +152,29 @@
}; };
} }
- (void)setPoint:(CLLocationCoordinate2D)point{ - (void)setPoint:(CLLocationCoordinate2D)point target:(NSInteger)target{
CLLocationCoordinate2D position = point; if (target == 1) {
GMSMarker *marker = [GMSMarker markerWithPosition:position]; CLLocationCoordinate2D position = point;
marker.title = @"Hello World"; _selfMarker.map = nil;
marker.map = _mapView; _selfMarker = [GMSMarker markerWithPosition:position];
// _selfMarker.appearAnimation = kGMSMarkerAnimationPop;
// _selfMarker.icon = [GMSMarker markerImageWithColor:[UIColor blackColor]];
_selfMarker.icon = [UIImage imageNamed:@"map_track_srart_end_icon"];
_selfMarker.tracksInfoWindowChanges = YES;
_selfMarker.title = @"Me";
_selfMarker.snippet = @"WTF";
_selfMarker.infoWindowAnchor = CGPointMake(0.5, 0.25);
_selfMarker.map = _mapView;
}else{
CLLocationCoordinate2D position = point;
GMSMarker *marker = [GMSMarker markerWithPosition:position];
marker.title = @"Hello World";
marker.map = _mapView;
}
}
-(void)mapView:(GMSMapView*)mapView idleAtCameraPosition:(GMSCameraPosition*)position{
_zoom = position.zoom;
} }
- (void)mapView:(UIView *)mapView regionDidChangeAnimated:(BOOL)animated { - (void)mapView:(UIView *)mapView regionDidChangeAnimated:(BOOL)animated {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment