//
//  RDSUserLocation.m
//  SmartLightForBigFish
//
//  Created by coderYK on 2017/9/11.
//  Copyright © 2017年 RD. All rights reserved.
//

#import "RDSUserLocation.h"
#import "NSString+convert.h"

@implementation RDSUserLocation

- (NSString *)description {
    
    return [NSString stringWithFormat:@"%@_%@_%@_%@_%@", self.latitude, self.longitude, self.provinceString, self.cityString, self.districtString];
}

- (NSString *)deviceLocation{
    
    NSString *provinceString = self.provinceString;
    NSString *cityString = self.cityString;
    NSString *districtString = self.districtString;
    
    provinceString  = [provinceString rds_utf8ToUnicode];
    cityString      = [cityString rds_utf8ToUnicode];
    districtString  = [districtString rds_utf8ToUnicode];
    
    NSString *locationStr = [NSString stringWithFormat:@"longitude=%@&latitude=%@&province=%@&city=%@&district=%@&sdkmap=baiduMap", self.longitude, self.latitude, provinceString, cityString, districtString];
    DDLog(@"locationStr: %@",locationStr);
    
    return locationStr;
}

//- (id)copyWithZone:(NSZone *)zone {
//    
//    RDSUserLocation *location = [[self class] allocWithZone:zone];
//    [location setValue:self.latitude forKeyPath:@"latitude"];
//    [location setValue:self.longitude forKeyPath:@"longitude"];
//    [location setValue:self.provinceString forKeyPath:@"provinceString"];
//    [location setValue:self.cityString forKeyPath:@"cityString"];
//    [location setValue:self.districtString forKeyPath:@"districtString"];
//    return location;
//}

@end
