这是关于我谈论的功能
- (void)getAddressFromLatLon:(double)pdblLatitude withLongitude: (double)pdblLongitude
{
NSDictionary *adressWithLtLn = @{
@"latitude":[NSNumber numberWithDouble:pdblLatitude],
@"longtitude":[NSNumber numberWithDouble:pdbllongtitude]};
[[NSNotificationCenter defaultCenter]postNotificationName:@"userAddress" object:adressWithLtLn];
}
监听器:
- (void)didGetAddressNotification:(NSNotification*)notification {
if ([notification object]!=nil){
NSDictionary *nott = [notification object];
if( nott!=NULL ){
currentAddress=nott;
}
}}
行动按钮
- (IBAction)pressButtonOrder:(id)sender {
if ([currentAddress count]>0){
Order *order = [[Order alloc]init];
[order sendOrder:[currentAddress objectForKey:@"latitude"] source_lng:[currentAddress objectForKey:@"longtitude"]];
}
}
和发件人
-(void)sendOrder:(NSNumber*)source_lat source_lng:(NSNumber*)source_lng;
{
API *api=[[API alloc]init] ;
NSDictionary *params = @{
@"imei":[api getUDID] ,
@"source_lat":source_lat,
@"source_lng":source_lng
};
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
[manager POST:@"http://" parameters:params
success:
^(AFHTTPRequestOperation *operation, id responseObject)
{
// some code…
}
failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
NSLog(@"Error JSON: %@", error);
}
];
}
如果值为:
pdblLatitude= 48.514266999999997 pdblLongitude= 32.256956000000002
结果我有:
FORM/POST PARAMETERS source_lat: 48.514267 source_lng: 32.256956
答案 0 :(得分:1)
错字:
<!-- BEGIN .item -->
<div id="fullBanner" class="item contain"
style="background-image: url('{{ 'slider-item-4.jpg' | asset_url }}');
background-size: contain !important;">
<!-- END .item -->
</div>
你想存储经度不是你......
编辑:这不包括截断方面,但是您显示的结果是字符串,因此您尚未公开的值会发生其他情况。