//
//  GuideMapController.h
//  ArcGis
//
//  Created by Mac Book DQ02 on 16/3/16.
//  Copyright © 2016年 Xu Mengzhu. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "BottomView.h"
#import "MarkCollectionViewCell.h"
#import "RouteView.h"
#import "MySearchView.h"
#import "AttractionDetailController.h"
#import "RouteTaskView.h"
#import "XMLAnalysisTool.h"
#import "SpotCallout.h"

@protocol GuideMapControllerDelegate <NSObject>

-(void)changeState;

@end

@interface GuideMapController : UIViewController<AGSMapViewLayerDelegate,AGSMapViewTouchDelegate,AGSLayerCalloutDelegate,UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout,CLLocationManagerDelegate,UITableViewDelegate,UITableViewDataSource,UIGestureRecognizerDelegate,BottomViewDelegate,RouteViewDelegate,MySearchViewDelegate,CalloutViewDelegate,RouteTaskInnerViewDelegate,RouteTaskViewDelegate,AGSLocationDisplayDataSourceDelegate>

@property (strong, nonatomic) AGSMapView *mapView;//show the map
@property (strong, nonatomic) AGSEnvelope *originalEnvelope;

@property (strong, nonatomic) BottomView *bottomView; //bottom view

//标签视图相关
@property (strong, nonatomic) UICollectionView *markCollectionView; //mark view
@property (strong, nonatomic) NSArray *normalImgArr;//save the imgName for the button of normalState
@property (strong, nonatomic) NSArray *selectImgArr;//save the imgName for the button of selectState
@property (strong ,nonatomic) NSArray *markLabelNameArr;//存的是标签下面文字的数组


@property (strong ,nonatomic) NSIndexPath *currentSelectIndex;//save the current selected indexPath;
@property BOOL state;//记录当前点击的按钮的点击状态

//用于标签按钮点击的时候添加s游步道，骑行道
@property (strong,nonatomic) AGSFeatureTableLayer *youbuFeatureTableLayer;//用于标记游步道
@property (strong, nonatomic) AGSFeatureTableLayer *ridingFeatureTableLayer;//用于标记骑行道
@property (strong, nonatomic) UIImageView *biaojiImgV;//用于表示道路颜色

//路线视图相关
@property (strong, nonatomic) RouteView *routeView;//routeView
@property (strong, nonatomic) AGSGraphicsLayer *routeLayer;//add route to map
@property (strong, nonatomic) AGSGraphicsLayer *markLayer;//add markSymbol to map
@property (nonatomic,strong) AGSGraphic *entryGra;//记录入口的graphic
@property (strong, nonatomic) AGSGraphicsLayer *entryMarkLayer;//显示入口标记的图层
@property (strong, nonatomic) AGSGraphicsLayer *baseMarkLayer;//地图底图上显示的人文景观的名字图层
//搜索框视图
@property (strong, nonatomic) MySearchView *searchView;
@property (strong, nonatomic) UITableView *resultTable;//display th search result
@property (strong, nonatomic) NSMutableArray *searchResultModelArr;//save the search result
@property (strong, nonatomic) NSMutableArray *searchResultGraphicArr;


@property (strong, nonatomic) CLLocationManager *locationManager;//用于罗盘旋转
@property int flag;//用于标志，是什么时候的定位，1表示是定位按钮点击时候的定位，2表示线路规划的时候定位 3，表示导航的时候定位

#pragma mark --路径规划相关视图，变量
/*
@property (strong, nonatomic) RouteTaskView *routeTaskView;//弹出的路径规划的视图
@property (strong, nonatomic) AGSRouteTask *routeTask;
@property (nonatomic, strong) AGSRouteTaskParameters *routeTaskParams;
@property (nonatomic, strong) AGSGraphicsLayer	*graphicsLayerStops;
@property (nonatomic, strong) AGSGraphicsLayer  *graphicsLayerRoute;
@property (nonatomic, assign) BOOL isTapRouting;//标记是否在路径规划
@property (nonatomic, strong) AGSRouteResult	*routeResult;
@property (nonatomic, assign) int numStops;
*/

//其它按钮，罗盘，定位，放大，缩小
@property (strong, nonatomic) UIButton *compassBtn;
@property (strong, nonatomic) UIButton *locationBtn;
@property (strong, nonatomic) UIButton *downloadBtn;
@property (strong, nonatomic) UIButton *routeTaskBtn;

//地图离线包下载
@property (nonatomic, strong) NSURLSession *session;
@property (nonatomic, strong) NSURLRequest *request;
@property (strong, nonatomic) NSURLSessionDownloadTask *downloadTask;// 下载句柄
@property (strong, nonatomic) NSData *resumeData;
@property (strong, nonatomic) UIProgressView *downloadProgressV;
@property (strong, nonatomic) UILabel *downloadProgressLab;
@property (assign, nonatomic) int downloadFlag;

@property (nonatomic,assign) long long total;
@property (nonatomic,assign) long long tmpTotal;//临时存储下载完成的文件大小
@property (assign, nonatomic) CLHeading *oldheading;

@property CGFloat contentViewWidth;
@property CGFloat contentViewHeight;

/**新改0715**/
@property (assign, nonatomic) BOOL fromAttractionMap;//区分是否是从景点详情点击地图进入的，yes表示‘是’，no表示是点击底部电子导游按钮进入的
@property (nonatomic, copy) NSString *spotName;
@property (nonatomic, copy) NSString *spotCode;//景点详情点击跳转过来，景点的信息

/**新改**/
@property (nonatomic, strong) SpotCallout *calloutView;//记录最后一次弹出气泡

@property (nonatomic , strong) UIAlertController *taskAlert;//路径规划的弹框

@end
