From 8970c23e656c11435231040e1edbaad987dc0977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=A2=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=80=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82?= =?UTF-8?q?=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83?= =?UTF-8?q?=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82?= =?UTF-8?q?=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=9Cosana?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=A2=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=80=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=82=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83?= =?UTF-8?q?=C3=83=C2=82=C3=82=C2=83=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82?= =?UTF-8?q?=C3=82=C2=82=C3=83=C2=83=C3=82=C2=83=C3=83=C2=82=C3=82=C2=82?= =?UTF-8?q?=C3=83=C2=83=C3=82=C2=82=C3=83=C2=82=C3=82=C2=9D?= Date: Thu, 21 Dec 2017 14:15:42 -0500 Subject: [android] add max & min latitude and longitude constants to maps sdk --- .../mapboxsdk/constants/GeometryConstants.java | 63 ++++++++++++++++++++++ .../java/com/mapbox/mapboxsdk/geometry/LatLng.java | 44 +++++++-------- .../mapbox/mapboxsdk/geometry/LatLngBounds.java | 21 +++++--- .../mapboxsdk/geometry/LatLngBoundsTest.java | 12 ++--- 4 files changed, 103 insertions(+), 37 deletions(-) create mode 100644 platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/GeometryConstants.java diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/GeometryConstants.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/GeometryConstants.java new file mode 100644 index 0000000000..1a7544d33a --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/GeometryConstants.java @@ -0,0 +1,63 @@ +package com.mapbox.mapboxsdk.constants; + +/** + * Contains constants used throughout the sdk classes. + * + * @since 6.0.0 + */ +public class GeometryConstants { + + /** + * The equatorial radius + * value in meters + * + * @since 6.0.0 + */ + public static final int RADIUS_EARTH_METERS = 6378137; + + /** + * This constant represents the lowest longitude value available to represent a geolocation. + * + * @since 6.0.0 + */ + public static final double MIN_LONGITUDE = -180; + + /** + * This constant represents the highest longitude value available to represent a geolocation. + * + * @since 6.0.0 + */ + public static final double MAX_LONGITUDE = 180; + + /** + * This constant represents the lowest latitude value available to represent a geolocation. + * + * @since 6.0.0 + */ + public static final double MIN_LATITUDE = -90; + + /** + * This constant represents the highest latitude value available to represent a geolocation. + * + * @since 6.0.0 + */ + public static final double MAX_LATITUDE = 90; + + /** + * Maximum latitude value in Mercator projection. + * + * @since 6.0.0 + */ + public static final double MAX_MERCATOR_LATITUDE = 85.05112877980659; + + /** + * Minimum latitude value in Mercator projection. + * + * @since 6.0.0 + */ + public static final double MIN_MERCATOR_LATITUDE = -85.05112877980659; + + private GeometryConstants() { + // Private constructor to prevent initializing of this class. + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.java index a92f2e21cb..79023e2fd9 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLng.java @@ -5,7 +5,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.support.annotation.FloatRange; -import com.mapbox.services.android.telemetry.constants.GeoConstants; +import com.mapbox.mapboxsdk.constants.GeometryConstants; /** @@ -105,20 +105,20 @@ public class LatLng implements ILatLng, Parcelable { /** * Set the latitude, in degrees. *

- * This value is in the range of [-85.05112878, 85.05112878], see {@link GeoConstants#MIN_LATITUDE} and - * {@link GeoConstants#MAX_LATITUDE} + * This value is in the range of [-90, 90], see {@link GeometryConstants#MIN_LATITUDE} and + * {@link GeometryConstants#MAX_LATITUDE} *

* * @param latitude the latitude value in degrees - * @see GeoConstants#MIN_LATITUDE - * @see GeoConstants#MAX_LATITUDE + * @see GeometryConstants#MIN_LATITUDE + * @see GeometryConstants#MAX_LATITUDE */ public void setLatitude( - @FloatRange(from = GeoConstants.MIN_LATITUDE, to = GeoConstants.MAX_LATITUDE) double latitude) { + @FloatRange(from = GeometryConstants.MIN_LATITUDE, to = GeometryConstants.MAX_LATITUDE) double latitude) { if (Double.isNaN(latitude)) { throw new IllegalArgumentException("latitude must not be NaN"); } - if (Math.abs(latitude) > 90.0) { + if (Math.abs(latitude) > GeometryConstants.MAX_LATITUDE) { throw new IllegalArgumentException("latitude must be between -90 and 90"); } this.latitude = latitude; @@ -127,13 +127,13 @@ public class LatLng implements ILatLng, Parcelable { /** * Get the latitude, in degrees. *

- * This value is in the range of [-85.05112878, 85.05112878], see {@link GeoConstants#MIN_LATITUDE} and - * {@link GeoConstants#MAX_LATITUDE} + * This value is in the range of [-90, 90], see {@link GeometryConstants#MIN_LATITUDE} and + * {@link GeometryConstants#MAX_LATITUDE} *

* * @return the latitude value in degrees - * @see GeoConstants#MIN_LATITUDE - * @see GeoConstants#MAX_LATITUDE + * @see GeometryConstants#MIN_LATITUDE + * @see GeometryConstants#MAX_LATITUDE */ @Override public double getLatitude() { @@ -143,15 +143,15 @@ public class LatLng implements ILatLng, Parcelable { /** * Set the longitude, in degrees. *

- * This value is in the range of [-180, 180], see {@link GeoConstants#MIN_LONGITUDE} and - * {@link GeoConstants#MAX_LONGITUDE} + * This value is in the range of [-180, 180], see {@link GeometryConstants#MIN_LONGITUDE} and + * {@link GeometryConstants#MAX_LONGITUDE} *

* * @param longitude the longitude value in degrees - * @see GeoConstants#MIN_LONGITUDE - * @see GeoConstants#MAX_LONGITUDE + * @see GeometryConstants#MIN_LONGITUDE + * @see GeometryConstants#MAX_LONGITUDE */ - public void setLongitude(@FloatRange(from = GeoConstants.MIN_LONGITUDE, to = GeoConstants.MAX_LONGITUDE) + public void setLongitude(@FloatRange(from = GeometryConstants.MIN_LONGITUDE, to = GeometryConstants.MAX_LONGITUDE) double longitude) { if (Double.isNaN(longitude)) { throw new IllegalArgumentException("longitude must not be NaN"); @@ -165,13 +165,13 @@ public class LatLng implements ILatLng, Parcelable { /** * Get the longitude, in degrees. *

- * This value is in the range of [-180, 180], see {@link GeoConstants#MIN_LONGITUDE} and - * {@link GeoConstants#MAX_LONGITUDE} + * This value is in the range of [-180, 180], see {@link GeometryConstants#MIN_LONGITUDE} and + * {@link GeometryConstants#MAX_LONGITUDE} *

* * @return the longitude value in degrees - * @see GeoConstants#MIN_LONGITUDE - * @see GeoConstants#MAX_LONGITUDE + * @see GeometryConstants#MIN_LONGITUDE + * @see GeometryConstants#MAX_LONGITUDE */ @Override public double getLongitude() { @@ -204,7 +204,7 @@ public class LatLng implements ILatLng, Parcelable { * @return new LatLng object with wrapped Longitude */ public LatLng wrap() { - return new LatLng(latitude, wrap(longitude, GeoConstants.MIN_LONGITUDE, GeoConstants.MAX_LONGITUDE)); + return new LatLng(latitude, wrap(longitude, GeometryConstants.MIN_LONGITUDE, GeometryConstants.MAX_LONGITUDE)); } @@ -330,6 +330,6 @@ public class LatLng implements ILatLng, Parcelable { final double t3 = Math.sin(a1) * Math.sin(b1); final double tt = Math.acos(t1 + t2 + t3); - return GeoConstants.RADIUS_EARTH_METERS * tt; + return GeometryConstants.RADIUS_EARTH_METERS * tt; } } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java index d56d18f52e..6d027a0cef 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java @@ -5,8 +5,8 @@ import android.os.Parcelable; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import com.mapbox.mapboxsdk.constants.GeometryConstants; import com.mapbox.mapboxsdk.exceptions.InvalidLatLngBoundsException; -import com.mapbox.services.android.telemetry.constants.GeoConstants; import java.util.ArrayList; import java.util.List; @@ -48,8 +48,8 @@ public class LatLngBounds implements Parcelable { */ public static LatLngBounds world() { return new LatLngBounds.Builder() - .include(new LatLng(GeoConstants.MAX_LATITUDE, GeoConstants.MAX_LONGITUDE)) - .include(new LatLng(GeoConstants.MIN_LATITUDE, GeoConstants.MIN_LONGITUDE)) + .include(new LatLng(GeometryConstants.MAX_LATITUDE, GeometryConstants.MAX_LONGITUDE)) + .include(new LatLng(GeometryConstants.MIN_LATITUDE, GeometryConstants.MIN_LONGITUDE)) .build(); } @@ -194,10 +194,10 @@ public class LatLngBounds implements Parcelable { * @return LatLngBounds */ static LatLngBounds fromLatLngs(final List latLngs) { - double minLat = 90; - double minLon = 180; - double maxLat = -90; - double maxLon = -180; + double minLat = GeometryConstants.MAX_LATITUDE; + double minLon = GeometryConstants.MAX_LONGITUDE; + double maxLat = GeometryConstants.MIN_LATITUDE; + double maxLon = GeometryConstants.MIN_LONGITUDE; for (final ILatLng gp : latLngs) { final double latitude = gp.getLatitude(); @@ -237,11 +237,16 @@ public class LatLngBounds implements Parcelable { } private static double lon_(int z, int x) { - return x / Math.pow(2.0, z) * 360.0 - GeoConstants.MAX_LONGITUDE; + return x / Math.pow(2.0, z) * 360.0 - GeometryConstants.MAX_LONGITUDE; } /** * Constructs a LatLngBounds from a Tile identifier. + * + * Returned bounds will have latitude in the range of Mercator projection. + * @see GeometryConstants#MIN_MERCATOR_LATITUDE + * @see GeometryConstants#MAX_MERCATOR_LATITUDE + * * @param z Tile zoom level. * @param x Tile X coordinate. * @param y Tile Y coordinate. diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngBoundsTest.java b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngBoundsTest.java index 4eb8e237fd..c3d13f0c66 100644 --- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngBoundsTest.java +++ b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngBoundsTest.java @@ -2,9 +2,9 @@ package com.mapbox.mapboxsdk.geometry; import android.os.Parcelable; +import com.mapbox.mapboxsdk.constants.GeometryConstants; import com.mapbox.mapboxsdk.exceptions.InvalidLatLngBoundsException; import com.mapbox.mapboxsdk.utils.MockParcel; -import com.mapbox.services.android.telemetry.constants.GeoConstants; import org.junit.Before; import org.junit.Test; @@ -276,13 +276,11 @@ public class LatLngBoundsTest { @Test public void fromTileID() { - //GeoConstants.MAX_LATITUDE is not defined to a high enough precision - double MAX_LATITUDE = 85.05112877980659; LatLngBounds bounds = LatLngBounds.from(0, 0, 0); - assertEquals(-GeoConstants.MAX_LONGITUDE, bounds.getLonWest(), DELTA); - assertEquals(-MAX_LATITUDE, bounds.getLatSouth(), DELTA); - assertEquals(GeoConstants.MAX_LONGITUDE, bounds.getLonEast(), DELTA); - assertEquals(MAX_LATITUDE, bounds.getLatNorth(), DELTA); + assertEquals(GeometryConstants.MIN_LONGITUDE, bounds.getLonWest(), DELTA); + assertEquals(GeometryConstants.MIN_MERCATOR_LATITUDE, bounds.getLatSouth(), DELTA); + assertEquals(GeometryConstants.MAX_LONGITUDE, bounds.getLonEast(), DELTA); + assertEquals(GeometryConstants.MAX_MERCATOR_LATITUDE, bounds.getLatNorth(), DELTA); bounds = LatLngBounds.from(10, 288, 385); assertEquals(-78.75, bounds.getLonWest(), DELTA); -- cgit v1.2.1