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"?>
<Scheme
LastUpgradeVersion = "1150"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
......@@ -39,7 +39,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
allowLocationSimulation = "NO">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
......@@ -50,6 +50,10 @@
ReferencedContainer = "container:ZhiJi.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<LocationScenarioReference
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
referenceType = "1">
</LocationScenarioReference>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
......
......@@ -8,6 +8,7 @@
#import "ZJBaseMapViewController.h"
#import <GoogleMaps/GoogleMaps.h>
#import "ZJLocationManager.h"
@interface ZJBaseMapViewController ()<MAMapViewDelegate, XMPopupListViewDelegate, GMSMapViewDelegate>
......@@ -20,7 +21,11 @@
@property (nonatomic, strong) ZJMapCardFriendSelectView *selectView;
@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
......@@ -43,6 +48,19 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [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{
......@@ -54,6 +72,8 @@
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.868 longitude:151.2086 zoom:12];
_zoom = 14;
///初始化地图
// self.mapView = [[MAMapView alloc] initWithFrame:self.view.bounds];
self.mapView = [GMSMapView mapWithFrame:self.view.bounds camera:camera];
......@@ -72,7 +92,7 @@
// [self.mapView performSelector:NSSelectorFromString(@"setMapLanguage:") withObject:@(1)];
// }
// _mapView.delegate = self;
_mapView.delegate = self;
// _mapView.zoomLevel = 14;
// _mapView.showsScale = false;
// _mapView.showsCompass = false;
......@@ -132,11 +152,29 @@
};
}
- (void)setPoint:(CLLocationCoordinate2D)point{
CLLocationCoordinate2D position = point;
GMSMarker *marker = [GMSMarker markerWithPosition:position];
marker.title = @"Hello World";
marker.map = _mapView;
- (void)setPoint:(CLLocationCoordinate2D)point target:(NSInteger)target{
if (target == 1) {
CLLocationCoordinate2D position = point;
_selfMarker.map = nil;
_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 {
......
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