Reputation: 49
-(double) pixelDistance:(float)lat1 Lng1:(float)lng1 Lat2:(float)lat2 Lng2:(float)lng2 Zoom:(double)zoom{
double x1 = [self lngToX:lng1];
double y1 = [self latToY:lat1];
double x2 = [self lngToX:lng2];
double y2 = [self latToY:lat2];
return sqrt(pow((x1-x2),2)+ pow((y1-y2),2)) >> (21 - zoom);
}
how to fix "invalid operands to binary expression double to double"? error at return line.
Upvotes: 0
Views: 911
Reputation: 318854
The right shift operator >> requires two integer arguments, not two double arguments.
Upvotes: 2