FINAL suepr merge step : added all modules to this super repos

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-19 16:46:59 +02:00
7585 changed files with 1723356 additions and 18 deletions

View File

@@ -0,0 +1,22 @@
<?php
// Ascension Island
function location_province_list_ac() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ac() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// Bounds manually eyeballed by bdragon in EPSG:4326 using the coordinate
// readout in udig, because the poly is grouped with Saint Helena.
return array(
'minlng' => -14.4278,
'minlat' => -7.9875,
'maxlng' => -14.2581,
'maxlat' => -7.8630,
);
}

View File

@@ -0,0 +1,25 @@
<?php
// Andorra
function location_province_list_ad() {
return array('ALV' => "Andorra la Vella",
'CAN' => "Canillo",
'ENC' => "Encamp",
'ESE' => "Escaldes-Engordany",
'LMA' => "La Massana",
'ORD' => "Ordino",
'SJL' => "Sant Julia de L<>ria");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ad() {
return array(
'minlng' => 1.3726,
'minlat' => 42.404867,
'maxlng' => 1.781219,
'maxlat' => 42.621636,
);
}

View File

@@ -0,0 +1,25 @@
<?php
// United Arab Emirates
function location_province_list_ae() {
return array('AZ' => "Abu Zaby",
'AJ' => "'Ajman",
'FU' => "Al Fujayrah",
'SH' => "Ash Shariqah",
'DU' => "Dubayy",
'RK' => "R'as al Khaymah",
'UQ' => "Umm al Qaywayn");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ae() {
return array(
'minlng' => 50.7756,
'minlat' => 22.540493,
'maxlng' => 56.3684,
'maxlat' => 26.241233,
);
}

View File

@@ -0,0 +1,50 @@
<?php
// Afghanistan
function location_province_list_af() {
return array('BDS' => "Badakhshan province",
'BDG' => "Badghis province",
'BGL' => "Baghlan province",
'BAL' => "Balkh province",
'BAM' => "Bamian province",
'FRA' => "Farah province",
'FYB' => "Faryab province",
'GHA' => "Ghazni province",
'GHO' => "Ghowr province",
'HEL' => "Helmand province",
'HER' => "Herat province",
'JOW' => "Jowzjan province",
'KAB' => "Kabul province",
'KAN' => "Kandahar province",
'KAP' => "Kapisa province",
'KHO' => "Khost province",
'KNR' => "Konar province",
'KDZ' => "Kondoz province",
'LAG' => "Laghman province",
'LOW' => "Lowgar province",
'NAN' => "Nangrahar province",
'NIM' => "Nimruz province",
'NUR' => "Nurestan province",
'ORU' => "Oruzgan province",
'PIA' => "Paktia province",
'PKA' => "Paktika province",
'PAR' => "Parwan province",
'SAM' => "Samangan province",
'SAR' => "Sar-e Pol province",
'TAK' => "Takhar province",
'WAR' => "Wardak province",
'ZAB' => "Zabol province");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_af() {
return array(
'minlng' => 60.5054,
'minlat' => 29.612733,
'maxlng' => 74.93195,
'maxlat' => 38.538967,
);
}

View File

@@ -0,0 +1,26 @@
<?php
// Antigua and Barbuda
function location_province_list_ag() {
return array('ASG' => "Saint George",
'ASJ' => "Saint John",
'ASM' => "Saint Mary",
'ASL' => "Saint Paul",
'ASR' => "Saint Peter",
'ASH' => "Saint Philip",
'BAR' => "Barbuda",
'RED' => "Redonda");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ag() {
return array(
'minlng' => -61.89365,
'minlat' => 16.9478,
'maxlng' => -61.64325,
'maxlat' => 17.735533,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Anguilla
function location_province_list_ai() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ai() {
return array(
'minlng' => -63.1879,
'minlat' => 18.137033,
'maxlng' => -62.9537,
'maxlat' => 18.248633,
);
}

View File

@@ -0,0 +1,54 @@
<?php
// Albania
function location_province_list_al() {
return array('BR' => "Berat",
'BU' => "Bulqize",
'DL' => "Delvine",
'DV' => "Devoll",
'DI' => "Diber",
'DR' => "Durres",
'EL' => "Elbasan",
'ER' => "Kolonje",
'FR' => "Fier",
'GJ' => "Gjirokaster",
'GR' => "Gramsh",
'HA' => "Has",
'KA' => "Kavaje",
'KB' => "Kurbin",
'KC' => "Kucove",
'KO' => "Korce",
'KR' => "Kruje",
'KU' => "Kukes",
'LB' => "Librazhd",
'LE' => "Lezhe",
'LU' => "Lushnje",
'MM' => "Malesi e Madhe",
'MK' => "Mallakaster",
'MT' => "Mat",
'MR' => "Mirdite",
'PQ' => "Peqin",
'PR' => "Permet",
'PG' => "Pogradec",
'PU' => "Puke",
'SH' => "Shkoder",
'SK' => "Skrapar",
'SR' => "Sarande",
'TE' => "Tepelene",
'TP' => "Tropoje",
'TR' => "Tirane",
'VL' => "Vlore");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_al() {
return array(
'minlng' => 19.29795,
'minlat' => 39.713733,
'maxlng' => 21.072,
'maxlat' => 42.7006,
);
}

View File

@@ -0,0 +1,29 @@
<?php
// Armenia
function location_province_list_am() {
return array('AGT' => "Aragatsotn",
'ARR' => "Ararat",
'ARM' => "Armavir",
'GEG' => "Geghark'unik'",
'KOT' => "Kotayk'",
'LOR' => "Lorri",
'SHI' => "Shirak",
'SYU' => "Syunik'",
'TAV' => "Tavush",
'VAY' => "Vayots' Dzor",
'YER' => "Yerevan");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_am() {
return array(
'minlng' => 43.4194,
'minlat' => 38.9416,
'maxlng' => 46.5982,
'maxlat' => 41.3796,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Netherlands Antilles
function location_province_list_an() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_an() {
return array(
'minlng' => -69.16155,
'minlat' => 11.711233,
'maxlng' => -66.13465,
'maxlat' => 12.397367,
);
}

View File

@@ -0,0 +1,36 @@
<?php
// Angola
function location_province_list_ao() {
return array('BGO' => "Bengo",
'BGU' => "Benguela province",
'BIE' => "Bie",
'CAB' => "Cabinda",
'CCU' => "Cuando-Cubango",
'CNO' => "Cuanza Norte",
'CUS' => "Cuanza Sul",
'CNN' => "Cunene",
'HUA' => "Huambo province",
'HUI' => "Huila province",
'LUA' => "Luanda",
'LNO' => "Lunda Norte",
'LSU' => "Lunda Sul",
'MAL' => "Malange",
'MOX' => "Moxico",
'NAM' => "Namibe",
'UIG' => "Uige",
'ZAI' => "Zaire");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ao() {
return array(
'minlng' => 11.57905,
'minlat' => -18.112767,
'maxlng' => 24.1105,
'maxlat' => -4.424667,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Antarctica
function location_province_list_aq() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_aq() {
return array(
'minlng' => -179.999427042259,
'minlat' => -89.9,
'maxlng' => 179.999427042256,
'maxlat' => -60.9997330347133,
);
}

View File

@@ -0,0 +1,42 @@
<?php
// Argentina
function location_province_list_ar() {
return array('A' => "Salta",
'B' => "Buenos Aires Province",
'C' => "Distrito Federal",
'D' => "San Luis",
'E' => "Entre Rios",
'F' => "La Rioja",
'G' => "Santiago del Estero",
'H' => "Chaco",
'J' => "San Juan",
'K' => "Catamarca",
'L' => "La Pampa",
'M' => "Mendoza",
'N' => "Misiones",
'P' => "Formosa",
'Q' => "Neuquen",
'R' => "Rio Negro",
'S' => "Santa Fe",
'T' => "Tucuman",
'U' => "Chubut",
'V' => "Tierra del Fuego",
'W' => "Corrientes",
'X' => "Cordoba",
'Y' => "Jujuy",
'Z' => "Santa Cruz");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ar() {
return array(
'minlng' => -73.4967,
'minlat' => -55.049767,
'maxlng' => -53.64205,
'maxlat' => -21.829967,
);
}

View File

@@ -0,0 +1,23 @@
<?php
// American Samoa
function location_province_list_as() {
return array('E' => "Eastern",
'M' => "Manu'a",
'R' => "Rose Island",
'S' => "Swains Island",
'W' => "Western");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_as() {
return array(
'minlng' => -170.9021,
'minlat' => -14.541433,
'maxlng' => -168.23395,
'maxlat' => -14.183633,
);
}

View File

@@ -0,0 +1,29 @@
<?php
// Austria
function location_province_list_at() {
return array(
'BUR' => "Burgenland",
'KAR' => "Kärnten",
'NOS' => "Niederösterreich",
'OOS' => "Oberösterreich",
'SAL' => "Salzburg",
'STE' => "Steiermark",
'TIR' => "Tirol",
'VOR' => "Vorarlberg",
'WIE' => "Wien",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_at() {
return array(
'minlng' => 9.47885,
'minlat' => 46.427367,
'maxlng' => 17.15825,
'maxlat' => 49.010433,
);
}

View File

@@ -0,0 +1,507 @@
<?php
// Australia
/**
* Returns a lat/lon pair of the approximate center of the given postal code in the given country
*
* @param $location
* An associative array $location where
* 'street' => the street portion of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* 'postal_code' => the international postal code for this location (REQUIRED)
*
* @return
* An associative array where
* 'lat' => approximate latitude of the center of the postal code's area
* 'lon' => approximate longitude of the center of the postal code's area
*
*/
function location_latlon_rough_au($location = array()) {
if (!isset($location['postal_code'])) {
return NULL;
}
$row = db_query("SELECT latitude, longitude FROM {zipcodes} WHERE country = :country AND zip = :zip", array(':country' => $location['country'], ':zip' => substr(str_pad($location['postal_code'], 4, '0', STR_PAD_LEFT), 0, 4)))->fetchObject();
if ($row) {
return array('lat' => $row->latitude, 'lon' => $row->longitude);
}
else {
return NULL;
}
}
/**
* Returns a lat/lon pair of the approximate center of the given postal code in the given country
*
* @param $location
* An associative array $location where only postal code and country are necessary, but can have the keys:
* 'street' => the street portion of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* 'postal_code' => the international postal code for this location (REQUIRED)
*
* @return
* An associative array where
* 'lat' => approximate latitude of the center of the postal code's area
* 'lon' => approximate longitude of the center of the postal code's area
*
*/
function _location_latlon_postalcode_au($location = array()) {
$dash_index = strpos($location['postal_code'], '-');
// First we strip slash off if we're dealing with a 8-digit AU zipcode
if (!($dash_index === FALSE)) {
$location['postal_code'] = substr($location['postal_code'], 0, $dash_index);
}
// Now we pad the thing and query.
$row = db_query("SELECT * FROM {zipcodes} where country = :country AND zip = :zip", array(':country' => $location['country'], ':zip' => str_pad($location['postal_code'], 4, "0", STR_PAD_LEFT)))->fetchObject();
if ($row) {
return array('lat' => $row->latitude, 'lon' => $row->longitude, 'city' => $row->city, 'province' => $row->state, 'country' => $row->country);
}
else {
return NULL;
}
}
/**
* Parameters:
* An associative array $location where
* 'street' => the street portion of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* 'postal_code' => the international postal code for this location (REQUIRED)
*
*
*/
function location_latlon_exact_au($location = array()) {
return NULL;
// By uncommenting the line of code below, you legally acknowledge that you understand that you can only
// do so under the terms of the Non-Commercial Share-alike license described at http://creativecommons.org/licenses/by-nc-sa/2.0/
//return _location_latlon_exact_us_geocoder($location);
}
/**
* Calls up a web-service to retrieve a lat/lon pair for a full, correct U.S. location.
*
* @param $location
* An associative array that represents an location where
* 'street' => is the street location
* 'supplemental' => any supplemental portion to the street location
* 'city' => city name
* 'province' => state, province, or territorial abbreviation
* 'postal_code' => postal code
*
* @return
* An associative array where
* 'lat' => Is a float value in latitude
* 'lon' => Is a float value in longitude
* If the location supplied does not provide enough information, NULL is returned.
* "Enough information" means that there is either
* (a valid 'street' AND valid 'postal_code') OR (valid 'street' AND valid 'city' AND valid 'province')
*/
function _location_latlon_exact_au_geocoder($location = array()) {
$location_string = '';
if (isset($location['street']) && trim($location['street']) != '') {
if (isset($location['postal_code'])) {
$location_string = $location['street'] .' '. $location['postal_code'];
}
elseif (isset($location['city']) && isset($location['province']) && trim($location['city']) != '' && trim($location['province'])) {
$location_string = $location['street'] .', '. $location['city'] .', '. $location['province'];
}
else { // else geocoder.us won't do bidness with you!
return NULL;
}
}
else {
return NULL;
}
$result = xmlrpc('http://rpc.geocoder.us/service/xmlrpc', array('geocode' => array($location_string)));
if (is_array($result) && is_array($result[0]) && isset($result[0]['lat']) && is_numeric($result[0]['lat']) && isset($result[0]['long']) && is_numeric($result[0]['long'])) {
return array('lat' => $result[0]['lat'], 'lon' => $result[0]['long']);
}
return NULL;
}
function location_map_link_au_yahoo($location = array()) {
$get_query = '?';
if (isset($location['street'])) {
$get_query .= 'addr='. urlencode($location['street']) .'&amp;';
}
if ($location['province'] != '' || $location['city'] != '' || $location['postal_code'] != '') {
$get_query .= 'csz='. _location_au_yahoo_csz_get_field($location) .'&amp;';
}
$get_query .= 'country='. urlencode($location['country']);
return ('http://maps.yahoo.com/maps_result'. $get_query);
}
function location_map_link_au_google($location = array()) {
$query_params = array();
foreach (array('street', 'city', 'province', 'postal_code', 'country') as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (count($query_params)) {
return ('http://maps.google.com?q='. urlencode(implode(", ", $query_params)));
}
else {
return NULL;
}
}
function location_map_link_au_mapquest($location = array()) {
if (isset($location['street'])) {
$get_query .= 'address='. urlencode($location['street']) .'&amp;';
}
if (isset($location['city'])) {
$get_query .= 'city='. urlencode($location['city']) .'&amp;';
}
if (isset($location['province'])) {
$get_query .= 'state='. urlencode($location['province']) .'&amp;';
}
if (isset($location['postal_code'])) {
$get_query .= 'zipcode='. urlencode($location['postal_code']);
}
if (strlen($get_query)) {
return 'http://www.mapquest.com/maps/map.adp?searchtype=address&amp;country=AU&amp;'. $get_query;
}
else {
return NULL;
}
}
/**
* @return
* An array where
* -> the key is the word that helps identify the name of function that builds the link. For example, a key of 'yahoo' means the name of the
* the function that builds a link to a map on Yahoo! Maps would be 'location_map_link_us_yahoo'
* -> the value is itself an array with 3 key/value pairs:
* 'name' => points to the name of the mapping service. For 'yahoo', this would be 'Yahoo! Maps'
* 'url' => the url of the main page of the mapping service. For 'yahoo', this would be 'http://maps.yahoo.com'
* 'tos' => the url of the page that explains the map providers Terms of Service, or Terms of Use. For 'yahoo', this would be
* 'http://help.yahoo.com/help/us/maps/maps-24.html'
*/
function location_map_link_au_providers() {
return array('google' => array('name' => 'Google Maps', 'url' => 'http://maps.google.com', 'tos' => 'http://www.google.com/help/terms_local.html'),
'yahoo' => array('name' => 'Yahoo! Maps', 'url' => 'http://maps.yahoo.com', 'tos' => 'http://help.yahoo.com/help/us/maps/maps-24.html'),
'mapquest' => array('name' => 'MapQuest', 'url' => 'http://www.mapquest.com', 'tos' => 'http://www.mapquest.com/features/main.adp?page=legal')
);
}
/**
* @return
* An array of values that work as keys to the array returned by location_map_link_us_providers. The idea is that if the
* administrator of the site has not yet had a chance to visit the "Map Links" subtab on the location module's settings page,
* that we can provide deep-linking to a relatively safe default. By 'relatively safe', we mean that the Terms Of Service of
* the provider of the maps are flexible enough for most parties.
*
* For the case of the U.S., 'google' has relatively flexible Terms Of Service, whereas Yahoo! Maps and MapQuest have more
* restrictive Terms Of Service.
*
*/
function location_map_link_au_default_providers() {
return array('google');
}
function location_geocode_au_providers() {
return array(
'yahoo' => array('name' => 'Yahoo! Maps Web Services', 'url' => 'http://developer.yahoo.com/maps/rest/V1/geocode.html', 'tos' => 'http://developer.yahoo.com/maps/mapsTerms.html'),
);
}
function location_geocode_au_yahoo_settings() {
$form = array();
$form['location_geocode_au_yahoo_appid'] = array(
'#type' => 'textfield',
'#title' => t('Yahoo! Web Services Application ID'),
'#size' => 64,
'#maxlength' => 128,
'#default_value' => variable_get('location_geocode_au_yahoo_appid', 'YahooDemo'),
'#description' => t('Unless you are using this site to test and develop, you will need to obtain a Yahoo! Web Services Application ID from the %network_link. If you are using for development and testing purposes, you can use \'YahooDemo\' as your AppID. When getting an Application ID from Yahoo!, please also be sure to review the %usage_policy.', array('%network_link' => '<a href="http://api.search.yahoo.com/webservices/register_application">Yahoo! Developer Network</a>', '%usage_policy' => '<a href="http://developer.yahoo.com/usagePolicy/index.html">usage policy</a>'))
);
return $form;
}
function location_geocode_au_yahoo($location = array()) {
$service_url = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=". variable_get('location_geocode_au_yahoo_appid', "YahooDemo") ."&location=";
$address = location_address2singleline($location);
$http_reply = drupal_http_request($service_url . urlencode($address));
// address may have been improperly formatted or invalid
if ($http_reply->code == 400) {
return NULL;
}
else {
// got a successful reply, but we only want to return if we have address-level precision
$matches = array();
preg_match('/precision="([a-z]*)"/', $http_reply->data, $matches);
if ($matches[1] != 'address') {
// The precision we got back was not down to the street-address level
return NULL;
}
else {
$lat_match = array();
$lon_match = array();
$latlon = array();
if (preg_match('/<Latitude>(.*)<\/Latitude>/', $http_reply->data, $lat_match)) {
$latlon['lat'] = $lat_match[1];
}
else {
return NULL;
}
if (preg_match('/<Longitude>(.*)<\/Longitude>/', $http_reply->data, $lon_match)) {
$latlon['lon'] = $lon_match[1];
return $latlon;
}
else {
return NULL;
}
}
}
}
/**
* Parameters:
* -> $location_a is an associative array that represents a full location where
* 'street' => the street portions of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* -> $location_b is associative array that represents a full location in the same way that
* parameter $location_b does.
*
* Returns: a link to driving directions
*
* For now, assume site-admin wants American driving directions linked to Yahoo! Driving Directions.
* Maybe later, we can add some kind of country-specific settings page that allows the site-admin to
* decide which site to link to for driving directions.
*/
function location_driving_directions_link_au($location_a, $location_b) {
return _location_driving_directions_link_au_yahoo($location_a, $location_b);
}
/**
* Parameters:
* Function that is called by location_driving_directions_link_au() under assumption that it
* is the chosen function
*
* Returns:
* a URL with HTTP GET variables
* Depending on how full the locationes are, the URL will either point to the driving directions
* on Yahoo! or, if only partial locationes are provided, a URL that points to the *form* for
* Yahoo! driving directions where the form is filled with whatever fields have been provided
* for the partial location(es).
*/
function _location_driving_directions_link_au_yahoo($location_a, $location_b) {
if (trim($location_b['country']) != 'ca' && trim($location_b['country']) != 'au') {
return '';
}
// These are the fields that need to be in each location if we are to provide a direct
// link to yahoo directions. If all of these fields don't have values, then we generate
// a link to the *form* for Yahoo! driving directions rather than directly to the driving
// directions themselves.
foreach ($location_a as $field => $value) {
$location_a[$field] = trim($value);
}
foreach ($location_b as $field => $value) {
$location_b[$field] = trim($value);
}
if (_location_au_enough_fields_for_yahoo($location_a) && _location_au_enough_fields_for_yahoo($location_b)) {
$yahoo_maps_path = 'dd_result';
}
else {
$yahoo_maps_path = 'dd';
}
$get_query = '?';
$get_query .= 'addr='. urlencode($location_a['street']) .'&amp;';
$get_query .= 'csz='. _location_au_yahoo_csz_get_field($location_a) .'&amp;';
$get_query .= 'country='. urlencode($location_a['country']) .'&amp;';
$get_query .= 'taddr='. urlencode($location_b['street']) .'&amp;';
$get_query .= 'tcsz='. _location_au_yahoo_csz_get_field($location_b) .'&amp;';
$get_query .= 'tcountry='. urlencode($location_b['country']);
$get_query .= '&amp;getrte='. urlencode('Get Directions');
return ('http://maps.yahoo.com/'. $yahoo_maps_path . $get_query);
}
function _location_au_enough_fields_for_yahoo($location) {
// These are the fields that need to be in each location if we are to provide a direct
// link to yahoo directions. If all of these fields don't have values, then we generate
// a link to the *form* for Yahoo! driving directions rather than directly to the driving
// directions themselves.
if (strlen($location['street']) && strlen($location['city']) && strlen($location['province'])) {
return TRUE;
}
if (strlen($location['street']) && strlen($location['postal_code'])) {
return TRUE;
}
if (strlen($location['street']) && strlen($location['city']) && strlen($location['province'])) {
return TRUE;
}
return FALSE;
}
/**
* Don't mess with this function unless you understand its logic. It has to do with
* the question of "to comma or not to comma?"
*/
function _location_au_yahoo_csz_get_field($location) {
// For some reasons, to the end of pinpointing a location, Yahoo! Maps and Driving Directions
// do better a better job with retrieving info based strictly on a Canadian city/province
// than on a Canadian postal code.
if ($location['country'] = 'ca') {
if (strlen($location['city']) && strlen($location['province'])) {
return urlencode($location['city'] .', '. $location['province']);
}
if (strlen($location['postal_code'])) {
return urlencode($location['postal_code']);
}
}
else {
if (strlen($location['postal_code'])) {
return urlencode($location['postal_code']);
}
if (strlen($location['city']) && strlen($location['province'])) {
return urlencode($location['city'] .', '. $location['province']);
}
}
if (strlen($location['city']) || strlen($location['state'])) {
if (strlen($location['city'])) {
return urlencode($location['city']);
}
else {
return urlencode($location['state']);
}
}
return '';
}
function _location_au_geocoder_oneline($location = array()) {
$line = '';
$line .= $location['street'] .', ';
if (strlen($location['city']) && strlen($location['province']) && strlen($location['postal_code'])) {
$line .= $location['city'] .', '. $location['province'] .' '. $location['postal_code'];
}
elseif (strlen($location['city']) && strlen($location['province'])) {
$line .= $location['city'] .', '. $location['state'];
}
elseif (strlen($location['postal_code'])) {
if (strlen($location['city']) || strlen($location['state'])) {
if (strlen($location['city'])) {
$line .= $location['city'] .', '. $location['postal_code'];
}
else {
$line .= $location['state'] .', '. $location['postal_code'];
}
}
else {
$line .= $location['postal_code'];
}
}
// DEBUG: commented code is for testing/debugging purposes
//print '_location_au_geocoder_oneline() RETURNING '. $line ."<br/>\n";
return $line;
}
/**
* Returns an associative array of states/territories where
* -> the keys are integers starting from 1
* -> the values are the English names for those states/territories
*
* The states are grouped together at the beginning of the array and sorted
* alphabetically.
*
* The territories are grouped together at the end of the array and sorted
* alphabetically.
*
*/
function location_province_list_au() {
return array(
'ACT' => 'Australian Capital Territory',
'NSW' => 'New South Wales',
'NT' => 'Northern Territory',
'QLD' => 'Queensland',
'SA' => 'South Australia',
'TAS' => 'Tasmania',
'VIC' => 'Victoria',
'WA' => 'Western Australia',
);
}
/**
* Returns an associative array of states/territories where
* -> the keys are integers starting from 1
* -> the values are the English names for those states/territories
*
* The states are grouped together at the beginning of the array and sorted
* alphabetically.
*
* The territories are grouped together at the end of the array and sorted
* alphabetically.
*
* Currently not being used, but may be in order to be compatible with CiviCRM
* TODO: These numeric indices need to be changed to match those in the CiviCRM database
*/
function location_province_list_numeric_au() {
return array(
'001' => "New South Wales",
'002' => "Queensland",
'003' => "South Australia",
'004' => "Tasmania",
'005' => "Victoria",
'006' => "Western Australia",
'007' => "Australian Capital Territory",
'008' => "Northern Territory",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_au() {
return array(
'minlng' => 72.57625,
'minlat' => -53.259967,
'maxlng' => 159.4839,
'maxlat' => -10.078033,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Aruba
function location_province_list_aw() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_aw() {
return array(
'minlng' => -70.08745,
'minlat' => 12.4276,
'maxlng' => -69.83805,
'maxlat' => 12.647367,
);
}

View File

@@ -0,0 +1,21 @@
<?php
// Aland Islands
function location_province_list_ax() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ax() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => 19.5137748,
'minlat' => 59.9044583,
'maxlng' => 21.0966239,
'maxlat' => 60.4807538,
);
}

View File

@@ -0,0 +1,94 @@
<?php
// Azerbaijan
function location_province_list_az() {
return array('AB' => "Ali Bayramli",
'ABS' => "Abseron",
'AGC' => "AgcabAdi",
'AGM' => "Agdam",
'AGS' => "Agdas,",
'AGA' => "Agstafa",
'AGU' => "Agsu",
'AST' => "Astara",
'BA' => "Baki",
'BAB' => "BabAk",
'BAL' => "BalakAn",
'BAR' => "BArdA",
'BEY' => "Beylaqan",
'BIL' => "Bilasuvar",
'CAB' => "Cabrayil",
'CAL' => "Calilabab",
'CUL' => "Culfa",
'DAS' => "Daskasan",
'DAV' => "Davaci",
'FUZ' => "Fuzuli",
'GA' => "Ganca",
'GAD' => "Gadabay",
'GOR' => "Goranboy",
'GOY' => "Goycay",
'HAC' => "Haciqabul",
'IMI' => "Imisli",
'ISM' => "Ismayilli",
'KAL' => "Kalbacar",
'KUR' => "Kurdamir",
'LA' => "Lankaran",
'LAC' => "Lacin",
'LAN' => "Lankaran",
'LER' => "Lerik",
'MAS' => "Masalli",
'MI' => "Mingacevir",
'NA' => "Naftalan",
'NEF' => "Neftcala",
'OGU' => "Oguz",
'ORD' => "Ordubad",
'QAB' => "Qabala",
'QAX' => "Qax",
'QAZ' => "Qazax",
'QOB' => "Qobustan",
'QBA' => "Quba",
'QBI' => "Qubadli",
'QUS' => "Qusar",
'SA' => "Saki",
'SAT' => "Saatli",
'SAB' => "Sabirabad",
'SAD' => "Sadarak",
'SAH' => "Sahbuz",
'SAK' => "Saki",
'SAL' => "Salyan",
'SM' => "Sumqayit",
'SMI' => "Samaxi",
'SKR' => "Samkir",
'SMX' => "Samux",
'SAR' => "Sarur",
'SIY' => "Siyazan",
'SS' => "Susa",
'SUS' => "Susa",
'TAR' => "Tartar",
'TOV' => "Tovuz",
'UCA' => "Ucar",
'XA' => "Xankandi",
'XAC' => "Xacmaz",
'XAN' => "Xanlar",
'XIZ' => "Xizi",
'XCI' => "Xocali",
'XVD' => "Xocavand",
'YAR' => "Yardimli",
'YEV' => "Yevlax",
'ZAN' => "Zangilan",
'ZAQ' => "Zaqatala",
'ZAR' => "Zardab",
'NX' => "Naxcivan");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_az() {
return array(
'minlng' => 44.7416,
'minlat' => 38.4074,
'maxlng' => 50.37515,
'maxlat' => 41.924867,
);
}

View File

@@ -0,0 +1,36 @@
<?php
// Bosnia and Herzegovina
function location_province_list_ba() {
return array('BRO' => "Brcko district",
'FUS' => "Unsko-Sanski Kanton",
'FPO' => "Posavski Kanton",
'FTU' => "Tuzlanski Kanton",
'FZE' => "Zenicko-Dobojski Kanton",
'FBP' => "Bosanskopodrinjski Kanton",
'FSB' => "Srednjebosanski Kanton",
'FHN' => "Hercegovacko-neretvanski Kanton",
'FZH' => "Zapadnohercegovacka Zupanija",
'FSA' => "Kanton Sarajevo",
'FZA' => "Zapadnobosanska",
'SBL' => "Banja Luka",
'SDO' => "Doboj",
'SBI' => "Bijeljina",
'SVL' => "Vlasenica",
'SSR' => "Sarajevo-Romanija or Sokolac",
'SFO' => "Foca",
'STR' => "Trebinje");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ba() {
return array(
'minlng' => 15.77965,
'minlat' => 42.621233,
'maxlng' => 19.61625,
'maxlat' => 45.251767,
);
}

View File

@@ -0,0 +1,29 @@
<?php
// Barbados
function location_province_list_bb() {
return array('CC' => "Christ Church",
'AND' => "Saint Andrew",
'GEO' => "Saint George",
'JAM' => "Saint James",
'JOH' => "Saint John",
'JOS' => "Saint Joseph",
'LUC' => "Saint Lucy",
'MIC' => "Saint Michael",
'PET' => "Saint Peter",
'PHI' => "Saint Philip",
'THO' => "Saint Thomas");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bb() {
return array(
'minlng' => -59.6715,
'minlat' => 13.018433,
'maxlng' => -59.3994,
'maxlat' => 13.285133,
);
}

View File

@@ -0,0 +1,24 @@
<?php
// Bangladesh
function location_province_list_bd() {
return array('BAR' => "Barisal",
'CHI' => "Chittagong",
'DHA' => "Dhaka",
'KHU' => "Khulna",
'RAJ' => "Rajshahi",
'SYL' => "Sylhet");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bd() {
return array(
'minlng' => 87.8338,
'minlat' => 20.794167,
'maxlng' => 92.67495,
'maxlat' => 26.491433,
);
}

View File

@@ -0,0 +1,67 @@
<?php
// Belgium
function location_province_list_be() {
return array(
'VAN' => "Antwerpen",
'VBR' => "Vlaams Brabant",
'VLI' => "Limburg",
'VOV' => "Oost-Vlaanderen",
'VWV' => "West-Vlaanderen",
'WBR' => "Brabant Wallon",
'WHT' => "Hainaut",
'WLG' => "Liege",
'WLX' => "Luxembourg",
'WNA' => "Namur",
// While technically not a province, Brussels-Capital Region is needed here
// because some places would be completely without a province if we did not
// include it.
// See http://drupal.org/node/228766 and http://drupal.org/node/291590.
'BRU' => "Brussels",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_be() {
return array(
'minlng' => 2.5104,
'minlat' => 49.518533,
'maxlng' => 6.3713,
'maxlat' => 51.528667,
);
}
function location_map_link_be_providers() {
return array(
'google' => array(
'name' => 'Google Maps',
'url' => 'http://maps.google.be/',
'tos' => 'http://maps.google.be/help/terms_maps.html',
),
);
}
function location_map_link_be_default_providers() {
return array('google');
}
function location_map_link_be_google($location = array()) {
$query_params = array();
foreach (array('street', 'city', 'postal_code', 'country') as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (count($query_params)) {
return ('http://maps.google.co.be?q='. urlencode(implode(', ', $query_params)));
}
else {
return NULL;
}
}

View File

@@ -0,0 +1,63 @@
<?php
// Burkina Faso
function location_province_list_bf() {
return array('BAL' => "Bale",
'BAM' => "Bam",
'BAN' => "Banwa",
'BAZ' => "Bazega",
'BOR' => "Bougouriba",
'BLG' => "Boulgou",
'BOK' => "Boulkiemde",
'COM' => "Comoe",
'GAN' => "Ganzourgou",
'GNA' => "Gnagna",
'GOU' => "Gourma",
'HOU' => "Houet",
'IOA' => "Ioba",
'KAD' => "Kadiogo",
'KEN' => "Kenedougou",
'KOD' => "Komondjari",
'KOP' => "Kompienga",
'KOS' => "Kossi",
'KOL' => "Koulpelogo",
'KOT' => "Kouritenga",
'KOW' => "Kourweogo",
'LER' => "Leraba",
'LOR' => "Loroum",
'MOU' => "Mouhoun",
'NAH' => "Nahouri",
'NAM' => "Namentenga",
'NAY' => "Nayala",
'NOU' => "Noumbiel",
'OUB' => "Oubritenga",
'OUD' => "Oudalan",
'PAS' => "Passore",
'PON' => "Poni",
'SAG' => "Sanguie",
'SAM' => "Sanmatenga",
'SEN' => "Seno",
'SIS' => "Sissili",
'SOM' => "Soum",
'SOR' => "Sourou",
'TAP' => "Tapoa",
'TUY' => "Tuy",
'YAG' => "Yagha",
'YAT' => "Yatenga",
'ZIR' => "Ziro",
'ZOD' => "Zondoma",
'ZOW' => "Zoundweogo");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bf() {
return array(
'minlng' => -5.5285,
'minlat' => 9.4826,
'maxlng' => 2.2205,
'maxlat' => 15.1109,
);
}

View File

@@ -0,0 +1,46 @@
<?php
// Bulgaria
function location_province_list_bg() {
return array('01' => "Blagoevgrad",
'02' => "Burgas",
'03' => "Varna",
'04' => "Veliko Turnovo",
'05' => "Vidin",
'06' => "Vratsa",
'07' => "Gabrovo",
'08' => "Dobrich",
'09' => "Kurdzhali",
'10' => "Kyustendil",
'11' => "Lovech",
'12' => "Montana",
'13' => "Pazardzhik",
'14' => "Pernik",
'15' => "Pleven",
'16' => "Plovdiv",
'17' => "Razgrad",
'18' => "Ruse",
'19' => "Silistra",
'20' => "Sliven",
'21' => "Smolyan",
'23' => "Sofia",
'22' => "Sofia Region",
'24' => "Stara Zagora",
'25' => "Turgovishte",
'26' => "Khaskovo",
'27' => "Shumen",
'28' => "Yambol");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bg() {
return array(
'minlng' => 22.34235,
'minlat' => 41.2841,
'maxlng' => 28.559,
'maxlat' => 44.237,
);
}

View File

@@ -0,0 +1,23 @@
<?php
// Bahrain
function location_province_list_bh() {
return array('CAP' => "Capital",
'CEN' => "Central",
'MUH' => "Muharraq",
'NOR' => "Northern",
'SOU' => "Southern");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bh() {
return array(
'minlng' => 50.402,
'minlat' => 25.862667,
'maxlng' => 50.66065,
'maxlat' => 26.339733,
);
}

View File

@@ -0,0 +1,34 @@
<?php
// Burundi
function location_province_list_bi() {
return array('BB' => "Bubanza",
'BJ' => "Bujumbura",
'BR' => "Bururi",
'CA' => "Cankuzo",
'CI' => "Cibitoke",
'GI' => "Gitega",
'KR' => "Karuzi",
'KY' => "Kayanza",
'KI' => "Kirundo",
'MA' => "Makamba",
'MU' => "Muramvya",
'MY' => "Muyinga",
'MW' => "Mwaro",
'NG' => "Ngozi",
'RT' => "Rutana",
'RY' => "Ruyigi");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bi() {
return array(
'minlng' => 29.17565,
'minlat' => -4.499667,
'maxlng' => 30.8881,
'maxlat' => -2.4882,
);
}

View File

@@ -0,0 +1,30 @@
<?php
// Benin
function location_province_list_bj() {
return array('AL' => "Alibori",
'AK' => "Atakora",
'AQ' => "Atlantique",
'BO' => "Borgou",
'CO' => "Collines",
'DO' => "Donga",
'KO' => "Kouffo",
'LI' => "Littoral",
'MO' => "Mono",
'OU' => "Oueme",
'PL' => "Plateau",
'ZO' => "Zou");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bj() {
return array(
'minlng' => 0.7266,
'minlat' => 6.189467,
'maxlng' => 3.81025,
'maxlat' => 12.340233,
);
}

View File

@@ -0,0 +1,29 @@
<?php
// Bermuda
function location_province_list_bm() {
return array('DS' => "Devonshire",
'HC' => "Hamilton City",
'HA' => "Hamilton",
'PG' => "Paget",
'PB' => "Pembroke",
'GC' => "Saint George City",
'SG' => "Saint George's",
'SA' => "Sandys",
'SM' => "Smith's",
'SH' => "Southampton",
'WA' => "Warwick");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bm() {
return array(
'minlng' => -64.98725,
'minlat' => 32.189967,
'maxlng' => -64.6069,
'maxlat' => 32.406167,
);
}

View File

@@ -0,0 +1,24 @@
<?php
// Brunei Darussalam
function location_province_list_bn() {
return array('BEL' => "Belait",
'BRM' => "Brunei and Muara",
'TEM' => "Temburong",
'TUT' => "Tutong");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bn() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => 113.999170,
'minlat' => 4.01668101,
'maxlng' => 115.360741,
'maxlat' => 5.05705678,
);
}

View File

@@ -0,0 +1,27 @@
<?php
// Bolivia
function location_province_list_bo() {
return array('BEN' => "Departmento Beni",
'CHU' => "Departmento Chuquisaca",
'COC' => "Departmento Cochabamba",
'LPZ' => "Departmento La Paz",
'ORU' => "Departmento Oruro",
'PAN' => "Departmento Pando",
'POT' => "Departmento Potosi",
'SCZ' => "Departmento Santa Cruz",
'TAR' => "Departmento Tarija");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bo() {
return array(
'minlng' => -69.706,
'minlat' => -22.762867,
'maxlng' => -57.49985,
'maxlat' => -9.6598,
);
}

View File

@@ -0,0 +1,107 @@
<?php
// This file contributed by Avi Alkalay <avi unix sh> to the
// Location Drupal module, based on other files on same folder.
//
// - Fixed Unicode chars and accents
// - Added support for Google Maps on location_map_link_*_providers()
//
// March, 2010
// São Paulo, Brazil
// Brazil
function location_province_list_br() {
return array(
'AC' => "Acre",
'AL' => "Alagoas",
'AM' => "Amazonas",
'AP' => "Amapá",
'BA' => "Bahia",
'CE' => "Ceara",
'DF' => "Distrito Federal",
'ES' => "Espírito Santo",
'GO' => "Goias",
'MA' => "Maranhão",
'MG' => "Minas Gerais",
'MS' => "Mato Grosso do Sul",
'MT' => "Mato Grosso",
'PA' => "Pará",
'PB' => "Paraíba",
'PE' => "Pernambuco",
'PI' => "Piaui",
'PR' => "Paraná",
'RJ' => "Rio de Janeiro",
'RN' => "Rio Grande do Norte",
'RO' => "Rondônia",
'RR' => "Roraima",
'RS' => "Rio Grande do Sul",
'SC' => "Santa Catarina",
'SE' => "Sergipe",
'SP' => "São Paulo",
'TO' => "Tocantins");
}
function location_map_link_br_providers() {
return array(
'google' => array(
'name' => 'Google Maps',
'url' => 'http://maps.google.com.br',
'tos' => 'http://maps.google.com/intl/pt-BR/help/terms_maps.html',
),
);
}
function location_map_link_br_default_providers() {
return array('google');
}
function location_map_link_br_google($location = array()) {
$query_params = array();
$q = NULL;
foreach (array('street', 'city', 'province', 'postal_code', 'country') as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (location_has_coordinates($location)) {
$q = $location['latitude'] . ' ' . $location['longitude'];
if ($location[name] != "") {
$q .= " ($location[name]," . implode(', ', $query_params) . ")";
} else {
$q .= ' (' . implode(', ', $query_params) . ')';
}
} else if (count($query_params) > 0) {
$q = implode(", ", $query_params);
if ($location[name] != "") {
$q .= " ($location[name])";
}
}
$q = urlencode($q);
if ($q != NULL) {
return ('http://maps.google.com.br?q='.$q );
}
else {
return NULL;
}
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_br() {
return array(
'minlng' => -73.97965,
'minlat' => -33.8089,
'maxlng' => -28.8133,
'maxlat' => 5.259233,
);
}

View File

@@ -0,0 +1,49 @@
<?php
// Bahamas
function location_province_list_bs() {
return array('ACK' => "Acklins",
'BER' => "Berry Islands",
'BIM' => "Bimini",
'BLK' => "Black Point",
'CAT' => "Cat Island",
'CAB' => "Central Abaco",
'CAN' => "Central Andros",
'CEL' => "Central Eleuthera",
'FRE' => "City of Freeport",
'CRO' => "Crooked Island",
'EGB' => "East Grand Bahama",
'EXU' => "Exuma",
'GRD' => "Grand Cay",
'HAR' => "Harbour Island",
'HOP' => "Hope Town",
'INA' => "Inagua",
'LNG' => "Long Island",
'MAN' => "Mangrove Cay",
'MAY' => "Mayaguana",
'MOO' => "Moore's Island",
'NAB' => "North Abaco",
'NAN' => "North Andros",
'NEL' => "North Eleuthera",
'RAG' => "Ragged Island",
'RUM' => "Rum Cay",
'SAL' => "San Salvador",
'SAB' => "South Abaco",
'SAN' => "South Andros",
'SEL' => "South Eleuthera",
'SWE' => "Spanish Wells",
'WGB' => "West Grand Bahama");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bs() {
return array(
'minlng' => -79.2951,
'minlat' => 20.8592,
'maxlng' => -72.6932,
'maxlat' => 27.0249,
);
}

View File

@@ -0,0 +1,38 @@
<?php
// Bhutan
function location_province_list_bt() {
return array('BUM' => "Bumthang",
'CHU' => "Chukha",
'DAG' => "Dagana",
'GAS' => "Gasa",
'HAA' => "Haa",
'LHU' => "Lhuntse",
'MON' => "Mongar",
'PAR' => "Paro",
'PEM' => "Pemagatshel",
'PUN' => "Punakha",
'SJO' => "Samdrup Jongkhar",
'SAT' => "Samtse",
'SAR' => "Sarpang",
'THI' => "Thimphu",
'TRG' => "Trashigang",
'TRY' => "Trashiyangste",
'TRO' => "Trongsa",
'TSI' => "Tsirang",
'WPH' => "Wangdue Phodrang",
'ZHE' => "Zhemgang");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bt() {
return array(
'minlng' => 88.668547,
'minlat' => 26.804233,
'maxlng' => 92.08275,
'maxlat' => 28.342233,
);
}

View File

@@ -0,0 +1,22 @@
<?php
// Bouvet Island
function location_province_list_bv() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bv() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// Bounds manually eyeballed by bdragon in EPSG:4326 using the coordinate
// readout in udig, because the poly is grouped with Norway.
return array(
'minlng' => 3.31,
'minlat' => -54.4823,
'maxlng' => 3.5201,
'maxlat' => -54.3444,
);
}

View File

@@ -0,0 +1,28 @@
<?php
// Botswana
function location_province_list_bw() {
return array('CE' => "Central",
'GH' => "Ghanzi",
'KD' => "Kgalagadi",
'KT' => "Kgatleng",
'KW' => "Kweneng",
'NG' => "Ngamiland",
'NE' => "North East",
'NW' => "North West",
'SE' => "South East",
'SO' => "Southern");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bw() {
return array(
'minlng' => 19.9836,
'minlat' => -26.8509,
'maxlng' => 29.2724,
'maxlat' => -17.837133,
);
}

View File

@@ -0,0 +1,24 @@
<?php
// Belarus
function location_province_list_by() {
return array('BR' => "Brest voblast",
'HO' => "Homyel voblast",
'HR' => "Hrodna voblast",
'MA' => "Mahilyow voblast",
'MI' => "Minsk voblast",
'VI' => "Vitsebsk voblast");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_by() {
return array(
'minlng' => 23.1605,
'minlat' => 51.331367,
'maxlng' => 32.6273,
'maxlat' => 56.223167,
);
}

View File

@@ -0,0 +1,24 @@
<?php
// Belize
function location_province_list_bz() {
return array('BZ' => "Belize District",
'CY' => "Cayo District",
'CR' => "Corozal District",
'OW' => "Orange Walk District",
'SC' => "Stann Creek District",
'TO' => "Toledo District");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_bz() {
return array(
'minlng' => -89.19635,
'minlat' => 15.799133,
'maxlng' => -87.64955,
'maxlat' => 18.4742,
);
}

View File

@@ -0,0 +1,402 @@
<?php
function location_province_list_ca() {
return array(
'AB' => 'Alberta',
'BC' => 'British Columbia',
'MB' => 'Manitoba',
'NB' => 'New Brunswick',
'NL' => 'Newfoundland and Labrador',
'NS' => 'Nova Scotia',
'ON' => 'Ontario',
'PE' => 'Prince Edward Island',
'QC' => 'Quebec',
'SK' => 'Saskatchewan',
'NT' => 'Northwest Territories',
'NU' => 'Nunavut',
'YT' => 'Yukon Territory',
);
}
function location_province_list_numeric_ca() {
return array(
'001' => 'Alberta',
'002' => 'British Columbia',
'003' => 'Manitoba',
'004' => 'New Brunswick',
'005' => 'Newfoundland and Labrador',
'006' => 'Nova Scotia',
'007' => 'Ontario',
'008' => 'Prince Edward Island',
'009' => 'Quebec',
'010' => 'Saskatchewan',
'011' => 'Northwest Territories',
'012' => 'Nunavut',
'013' => 'Yukon Territory',
);
}
/**
* Returns a lat/lon pair of the approximate center of the given postal code in the given country
*
* @param $location
* An associative array $location where
* 'street' => the street portion of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* 'postal_code' => the international postal code for this location (REQUIRED)
*
* @return
* An associative array where
* 'lat' => approximate latitude of the center of the postal code's area
* 'lon' => approximate longitude of the center of the postal code's area
*
*/
function location_latlon_rough_ca($location = array()) {
if (!isset($location['postal_code'])) {
return NULL;
}
$row = db_query("SELECT latitude, longitude FROM {zipcodes} WHERE country = :country AND zip = :zip", array(':country' => $location['country'], ':zip' => $location['postal_code']))->fetchObject();
if ($row) {
return array('lat' => $row->latitude, 'lon' => $row->longitude);
}
else {
return NULL;
}
}
/**
* Returns a lat/lon pair of the approximate center of the given postal code in the given country
*
* @param $location
* An associative array $location where only postal code and country are necessary, but can have the keys:
* 'street' => the street portion of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* 'postal_code' => the international postal code for this location (REQUIRED)
*
* @return
* An associative array where
* 'lat' => approximate latitude of the center of the postal code's area
* 'lon' => approximate longitude of the center of the postal code's area
* 'city' => the city
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code
*
*/
function location_get_postalcode_data_ca($location = array()) {
// Now we pad the thing and query.
$row = db_query("SELECT * FROM {zipcodes} where country = :country AND zip = :zip", array(':country' => $location['country'], ':zip' => $location['postal_code']))->fetchObject();
if ($row) {
return array('lat' => $row->latitude, 'lon' => $row->longitude, 'city' => $row->city, 'province' => $row->state, 'country' => $row->country);
}
else {
return NULL;
}
}
/**
* Parameters:
* An associative array $location where
* 'street' => the street portion of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* 'postal_code' => the international postal code for this location (REQUIRED)
*
*
*/
function location_latlon_exact_ca($location = array()) {
// return location_geocode_ca_geocoder($location);
}
function location_map_link_ca_yahoo($location = array()) {
$get_query = '?';
if (isset($location['street'])) {
$get_query .= 'addr='. urlencode($location['street']) .'&amp;';
}
if ($location['province'] != '' || $location['city'] != '' || $location['postal_code'] != '') {
$get_query .= 'csz='. _location_ca_yahoo_csz_get_field($location) .'&amp;';
}
$get_query .= 'country='. urlencode($location['country']);
return ('http://ca.maps.yahoo.com/maps_result'. $get_query);
}
function location_map_link_ca_google($location = array()) {
$query_params = array();
foreach (array('street', 'city', 'province', 'postal_code', 'country') as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (count($query_params)) {
return ('http://maps.google.ca?q='. urlencode(implode(", ", $query_params)));
}
else {
return NULL;
}
}
function location_map_link_ca_mapquest($location = array()) {
if (isset($location['street'])) {
$get_query .= 'address='. urlencode($location['street']) .'&amp;';
}
if (isset($location['city'])) {
$get_query .= 'city='. urlencode($location['city']) .'&amp;';
}
if (isset($location['province'])) {
$get_query .= 'state='. urlencode($location['province']) .'&amp;';
}
if (isset($location['postal_code'])) {
$get_query .= 'zipcode='. urlencode($location['postal_code']);
}
if (strlen($get_query)) {
return 'http://www.mapquest.com/maps/map.adp?searchtype=address&amp;country=CA&amp;'. $get_query;
}
else {
return NULL;
}
}
function location_map_link_ca_providers() {
return array('google' => array('name' => 'Google Maps', 'url' => 'http://maps.google.ca', 'tos' => 'http://www.google.ca/help/terms_local.html'),
'yahoo' => array('name' => 'Yahoo! Maps', 'url' => 'http://ca.maps.yahoo.com' , 'tos' => 'http://help.yahoo.com/help/ca/maps/maps-25.html'),
'mapquest' => array('name' => 'MapQuest', 'url' => 'http://www.mapquest.com', 'tos' => 'http://www.mapquest.com/features/main.adp?page=legal')
);
}
function location_map_link_ca_default_providers() {
return array('google');
}
/**
* Parameters:
* -> $location_a is an associative array that represents a full location where
* 'street' => the street portions of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* -> $location_b is associative array that represents a full location in the same way that
* parameter $location_b does.
*
* Returns: a link to driving directions
*
* For now, assume site-admin wants American driving directions linked to Yahoo! Driving Directions.
* Maybe later, we can add some kind of country-specific settings page that allows the site-admin to
* decide which site to link to for driving directions.
*/
function location_driving_directions_link_ca($location_a, $location_b) {
return _location_driving_directions_link_ca_yahoo($location_a, $location_b);
}
/**
* Parameters:
* Function that is called by location_driving_directions_link_ca() under assumption that it
* is the chosen function
*
* Returns:
* a URL with HTTP GET variables
* Depending on how full the locationes are, the URL will either point to the driving directions
* on Yahoo! or, if only partial locationes are provided, a URL that points to the *form* for
* Yahoo! driving directions where the form is filled with whatever fields have been provided
* for the partial location(es).
*/
function _location_driving_directions_link_ca_yahoo($location_a, $location_b) {
if (trim($location_b['country']) != 'ca' && trim($location_b['country']) != 'us') {
return '';
}
// These are the fields that need to be in each location if we are to provide a direct
// link to yahoo directions. If all of these fields don't have values, then we generate
// a link to the *form* for Yahoo! driving directions rather than directly to the driving
// directions themselves.
foreach ($location_a as $field => $value) {
$location_a[$field] = trim($value);
}
foreach ($location_b as $field => $value) {
$location_b[$field] = trim($value);
}
if (_location_ca_enough_fields_for_yahoo($location_a) && _location_ca_enough_fields_for_yahoo($location_b)) {
$yahoo_maps_path = 'dd_result';
}
else {
$yahoo_maps_path = 'dd';
}
$get_query = '?';
$get_query .= 'addr='. urlencode($location_a['street']) .'&amp;';
$get_query .= 'csz='. _location_ca_yahoo_csz_get_field($location_a) .'&amp;';
$get_query .= 'country='. urlencode($location_a['country']) .'&amp;';
$get_query .= 'taddr='. urlencode($location_b['street']) .'&amp;';
$get_query .= 'tcsz='. _location_ca_yahoo_csz_get_field($location_b) .'&amp;';
$get_query .= 'tcountry='. urlencode($location_b['country']);
$get_query .= '&amp;getrte='. urlencode('Get Directions');
return ('http://ca.maps.yahoo.com/'. $yahoo_maps_path . $get_query);
}
function _location_ca_enough_fields_for_yahoo($location) {
// These are the fields that need to be in each location if we are to provide a direct
// link to yahoo directions. If all of these fields don't have values, then we generate
// a link to the *form* for Yahoo! driving directions rather than directly to the driving
// directions themselves.
if (strlen($location['street']) && strlen($location['city']) && strlen($location['province'])) {
return TRUE;
}
if (strlen($location['street']) && strlen($location['postal_code'])) {
return TRUE;
}
if (strlen($location['street']) && strlen($location['city']) && strlen($location['province'])) {
return TRUE;
}
return FALSE;
}
// Don't mess with this function unless you understand its logic. It has to do with
// the question of "to comma or not to comma?"
function _location_ca_yahoo_csz_get_field($location) {
// For some reasons, to the end of pinpointing a location, Yahoo! Maps and Driving Directions
// do better a better job with retrieving info based strictly on a Canadian city/province
// than on a Canadian postal code.
if ($location['country'] = 'ca') {
if (strlen($location['city']) && strlen($location['province'])) {
return urlencode($location['city'] .', '. $location['province']);
}
if (strlen($location['postal_code'])) {
return urlencode($location['postal_code']);
}
}
else {
if (strlen($location['postal_code'])) {
return urlencode($location['postal_code']);
}
if (strlen($location['city']) && strlen($location['province'])) {
return urlencode($location['city'] .', '. $location['province']);
}
}
if (strlen($location['city']) || strlen($location['province'])) {
if (strlen($location['city'])) {
return urlencode($location['city']);
}
else {
return urlencode($location['province']);
}
}
return '';
}
function location_geocode_ca_providers() {
return array(
'geocoder' => array('name' => 'GeoCode.ca geocoding service', 'url' => 'http://geocoder.ca/?api=1', 'tos' => 'http://geocoder.ca/?terms=1http://geocoder.ca/?terms=1'),
);
}
function location_geocode_ca_geocoder_settings() {
$form = array();
$form['location_geocode_ca_geocoder_apikey'] = array(
'#type' => 'textfield',
'#title' => t('Geocoder API Key'),
'#size' => 64,
'#maxlength' => 128,
'#default_value' => variable_get('location_geocode_ca_geocoder_apikey', ''),
'#description' => t('In order to use the Geocoder.ca API geocoding web-service, if you are a commercial entity or wish to use the service without attribution, you will need a Geocoder API Key. You can obtain one at the !sign_up_link for the !geocoder_api.', array('!sign_up_link' => '<a href="http://geocoder.ca/?register=1">sign-up page</a>', '!geocoder_api' => '<a href="http://geocoder.ca/?premium_api=1">Geocoder API</a>'))
);
return $form;
}
/**
* This needs some more work to cover errors and such. I think showing a proper
* Drupal error is a good idea. If an incorrect address is given to geocoder.ca
* it offers a suggestion. If this happens the drupal user should be told.
*/
function location_geocode_ca_geocoder($location = array()) {
$service_url = "http://geocoder.ca/?geoit=XML";
if (variable_get('location_geocode_ca_geocoder_apikey', '')) {
$service_url .= '&auth='. variable_get('location_geocode_ca_geocoder_apikey', NULL) .'&locate=';
}
else {
$service_url .= '&locate=';
}
// geocoder gives better results when not usong postal code, country and ,
unset($location['postal_code'], $location['country']);
$address = strtr(location_address2singleline($location), array(', ' => ' '));
$http_reply = drupal_http_request($service_url . urlencode($address));
if ($http_reply->code == 400) {
return NULL;
}
else {
$matches = array();
$lat_match = array();
$lon_match = array();
$latlon = array();
if (preg_match('/<error>(.*)<\/error>/', $http_reply->data, $lat_match)) {
return NULL;
}
if (preg_match('/<latt>(.*)<\/latt>/', $http_reply->data, $lat_match)) {
$latlon['lat'] = $lat_match[1];
}
else {
return NULL;
}
if (preg_match('/<longt>(.*)<\/longt>/', $http_reply->data, $lon_match)) {
$latlon['lon'] = $lon_match[1];
return $latlon;
}
else {
return NULL;
}
}
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ca() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => -141.00554,
'minlat' => 41.6690855,
'maxlng' => -52.615930,
'maxlat' => 83.1161164,
);
}

View File

@@ -0,0 +1,23 @@
<?php
// Cocos (Keeling) Islands
function location_province_list_cc() {
return array('D' => "Direction Island",
'H' => "Home Island",
'O' => "Horsburgh Island",
'S' => "South Island",
'W' => "West Island");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cc() {
return array(
'minlng' => 95.2723,
'minlat' => -12.2493,
'maxlng' => 96.8062,
'maxlat' => -11.742167,
);
}

View File

@@ -0,0 +1,33 @@
<?php
// Congo, The Democratic Republic of the
function location_province_list_cd() {
return array(
'BC' => "Bas-Congo",
'BN' => "Bandundu",
'EQ' => "Equateur",
'KA' => "Katanga",
'KE' => "Kasai-Oriental",
'KN' => "Kinshasa",
'KW' => "Kasai-Occidental",
'MA' => "Maniema",
'NK' => "Nord-Kivu",
'OR' => "Orientale",
'SK' => "Sud-Kivu",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cd() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => 12.2109131,
'minlat' => -13.458350,
'maxlng' => 31.2804468,
'maxlat' => 5.37528025,
);
}

View File

@@ -0,0 +1,35 @@
<?php
// Central African Republic
function location_province_list_cf() {
return array('BBA' => "Bamingui-Bangoran",
'BKO' => "Basse-Kotto",
'HKO' => "Haute-Kotto",
'HMB' => "Haut-Mbomou",
'KEM' => "Kemo",
'LOB' => "Lobaye",
'MKD' => "Mambere-Kade<64>",
'MBO' => "Mbomou",
'NMM' => "Nana-Mambere",
'OMP' => "Ombella-M'Poko",
'OUK' => "Ouaka",
'OUH' => "Ouham",
'OPE' => "Ouham-Pende",
'VAK' => "Vakaga",
'NGR' => "Nana-Grebizi",
'SMB' => "Sangha-Mbaere",
'BAN' => "Bangui");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cf() {
return array(
'minlng' => 14.512,
'minlat' => 2.727,
'maxlng' => 27.4848,
'maxlat' => 11.062967,
);
}

View File

@@ -0,0 +1,33 @@
<?php
// Congo
function location_province_list_cg() {
return array(
'BO' => "Bouenza",
'BR' => "Brazzaville",
'CU' => "Cuvette",
'CO' => "Cuvette-Ouest",
'KO' => "Kouilou",
'LE' => "Lekoumou",
'LI' => "Likouala",
'NI' => "Niari",
'PL' => "Plateaux",
'PO' => "Pool",
'SA' => "Sangha",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cg() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => 11.1275683,
'minlat' => -5.0134396,
'maxlng' => 18.6424068,
'maxlat' => 3.70827606,
);
}

View File

@@ -0,0 +1,113 @@
<?php
// Switzerland
function location_province_list_ch() {
return array(
'ZH' => "Zurich",
'BE' => "Bern",
'LU' => "Lucerne",
'UR' => "Uri",
'SZ' => "Schwyz",
'OW' => "Obwalden",
'NW' => "Nidwalden",
'GL' => "Glarus",
'ZG' => "Zug",
'FR' => "Fribourg",
'SO' => "Solothurn",
'BS' => "Basel-Stadt",
'BL' => "Basel-Landschaft",
'SH' => "Schaffhausen",
'AR' => "Appenzell Ausserrhoden",
'AI' => "Appenzell Innerhoden",
'SG' => "St. Gallen",
'GR' => "Graubunden",
'AG' => "Aargau",
'TG' => "Thurgau",
'TI' => "Ticino",
'VD' => "Vaud",
'VS' => "Valais",
'NE' => "Neuchatel",
'GE' => "Geneva",
'JU' => "Jura",
);
}
function location_map_link_ch_providers() {
return array(
'search' => array(
'name' => 'map.search.ch',
'url' => 'http://map.search.ch',
'tos' => 'http://map.search.ch/terms.html',
),
'google' => array(
'name' => 'Google Maps',
'url' => 'http://maps.google.ch',
'tos' => 'http://www.google.ch/help/terms_maps.html',
),
);
}
function location_map_link_ch_default_providers() {
return array('search', 'google');
}
function location_map_link_ch_google($location = array()) {
$query_params = array();
foreach (array('street', 'city', 'postal_code', 'country') as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (count($query_params)) {
return ('http://maps.google.ch?q='. urlencode(implode(', ', $query_params)));
}
else {
return NULL;
}
}
function location_map_link_ch_search($location = array()) {
$query_param = '';
if ($location['postal_code'] || $location['city'] || $location['street']) {
$query_param = $location['postal_code'] . '-' . $location['city'] . '/' . $location['street'];
return 'http://map.search.ch/' . $query_param;
}
else {
return NULL;
}
}
function location_driving_directions_link_ch($location_a, $location_b) {
return _location_driving_directions_link_ch_search($location_a, $location_b);
}
function _location_driving_directions_link_ch_search($location_a, $location_b) {
$query_params_a = array();
$query_params_b = array();
foreach (array('street', 'postal_code', 'city') as $field) {
if (isset($location_a[$field])) {
$query_params_a[] = $location_a[$field];
}
if (isset($location_b[$field])) {
$query_params_b[] = $location_b[$field];
}
}
return 'http://route.search.ch/?route=' . urlencode(implode(' ', $query_params_a) . ' to ' .implode(' ', $query_params_b));
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ch() {
return array(
'minlng' => 5.8814,
'minlat' => 45.7606,
'maxlng' => 10.58005,
'maxlat' => 47.693367,
);
}

View File

@@ -0,0 +1,80 @@
<?php
// Cote D'Ivoire
function location_province_list_ci() {
return array(
'ABE' => "Abengourou",
'ABI' => "Abidjan",
'ABO' => "Aboisso",
'ADI' => "Adiake",
'ADZ' => "Adzope",
'AGB' => "Agboville",
'AGN' => "Agnibilekrou",
'ALE' => "Alepe",
'BOC' => "Bocanda",
'BAN' => "Bangolo",
'BEO' => "Beoumi",
'BIA' => "Biankouma",
'BDK' => "Bondoukou",
'BGN' => "Bongouanou",
'BFL' => "Bouafle",
'BKE' => "Bouake",
'BNA' => "Bouna",
'BDL' => "Boundiali",
'DKL' => "Dabakala",
'DBU' => "Dabou",
'DAL' => "Daloa",
'DAN' => "Danane",
'DAO' => "Daoukro",
'DIM' => "Dimbokro",
'DIV' => "Divo",
'DUE' => "Duekoue",
'FER' => "Ferkessedougou",
'GAG' => "Gagnoa",
'GBA' => "Grand-Bassam",
'GLA' => "Grand-Lahou",
'GUI' => "Guiglo",
'ISS' => "Issia",
'JAC' => "Jacqueville",
'KAT' => "Katiola",
'KOR' => "Korhogo",
'LAK' => "Lakota",
'MAN' => "Man",
'MKN' => "Mankono",
'MBA' => "Mbahiakro",
'ODI' => "Odienne",
'OUM' => "Oume",
'SAK' => "Sakassou",
'SPE' => "San-Pedro",
'SAS' => "Sassandra",
'SEG' => "Seguela",
'SIN' => "Sinfra",
'SOU' => "Soubre",
'TAB' => "Tabou",
'TAN' => "Tanda",
'TIE' => "Tiebissou",
'TIN' => "Tingrela",
'TIA' => "Tiassale",
'TBA' => "Touba",
'TLP' => "Toulepleu",
'TMD' => "Toumodi",
'VAV' => "Vavoua",
'YAM' => "Yamoussoukro",
'ZUE' => "Zuenoula",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ci() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => -8.6187198,
'minlat' => 4.34392201,
'maxlng' => -2.5063280,
'maxlat' => 10.7264781,
);
}

View File

@@ -0,0 +1,33 @@
<?php
// Cook Islands
function location_province_list_ck() {
return array('PU' => "Pukapuka",
'RK' => "Rakahanga",
'MK' => "Manihiki",
'PE' => "Penrhyn",
'NI' => "Nassau Island",
'SU' => "Surwarrow",
'PA' => "Palmerston",
'AI' => "Aitutaki",
'MA' => "Manuae",
'TA' => "Takutea",
'MT' => "Mitiaro",
'AT' => "Atiu",
'MU' => "Mauke",
'RR' => "Rarotonga",
'MG' => "Mangaia");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ck() {
return array(
'minlng' => -165.7749,
'minlat' => -11.650367,
'maxlng' => -165.37025,
'maxlat' => -10.815933,
);
}

View File

@@ -0,0 +1,31 @@
<?php
// Chile
function location_province_list_cl() {
return array('AI' => "Aisen del General Carlos Ibanez del Campo (XI)",
'AN' => "Antofagasta (II)",
'AR' => "Araucania (IX)",
'AT' => "Atacama (III)",
'BI' => "Bio-Bio (VIII)",
'CO' => "Coquimbo (IV)",
'LI' => "Libertador General Bernardo O'Higgins (VI)",
'LL' => "Los Lagos (X)",
'MA' => "Magallanes (XII)",
'ML' => "Maule (VII)",
'RM' => "Region Metropolitana (RM)",
'TA' => "Tarapaca (I)",
'VS' => "Valparaiso (V)");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cl() {
return array(
'minlng' => -89.1566,
'minlat' => -56.3359,
'maxlng' => -66.53165,
'maxlat' => -17.5216,
);
}

View File

@@ -0,0 +1,28 @@
<?php
// Cameroon
function location_province_list_cm() {
return array('ADA' => "Adamawa Province (Adamaoua)",
'CEN' => "Centre Province",
'EST' => "East Province (Est)",
'EXN' => "Extreme North Province (Extr<74>me-Nord)",
'LIT' => "Littoral Province",
'NOR' => "North Province (Nord)",
'NOT' => "Northwest Province (Nord-Ouest)",
'OUE' => "West Province (Ouest)",
'SUD' => "South Province (Sud)",
'SOU' => "Southwest Province (Sud-Ouest).");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cm() {
return array(
'minlng' => 8.34605,
'minlat' => 1.648433,
'maxlng' => 16.32655,
'maxlat' => 13.158733,
);
}

View File

@@ -0,0 +1,56 @@
<?php
// China
function location_province_list_cn() {
return array(
'11' => "Beijing",
'12' => "Tianjin",
'13' => "Hebei",
'14' => "Shanxi",
'15' => "Nei Mongol",
'21' => "Liaoning",
'22' => "Jilin",
'23' => "Heilongjiang",
'31' => "Shanghai",
'32' => "Jiangsu",
'33' => "Zhejiang",
'34' => "Anhui",
'35' => "Fujian",
'36' => "Jiangxi",
'37' => "Shandong",
'41' => "Henan",
'42' => "Hubei",
'43' => "Hunan",
'44' => "Guangdong",
'45' => "Guangxi",
'46' => "Hainan",
'51' => "Sichuan",
'52' => "Guizhou",
'53' => "Yunnan",
'54' => "Xizang (Tibet)",
'61' => "Shaanxi",
'62' => "Gansu",
'63' => "Qinghai",
'64' => "Ningxia",
'65' => "Xinjiang",
'71' => "Taiwan",
'91' => "Xianggang",
'92' => "Aomen",
'97' => "Chongqing",
'98' => "Gaoxiong",
'99' => "Taibei",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cn() {
return array(
'minlng' => 73.5403,
'minlat' => 16.0968,
'maxlng' => 134.7658,
'maxlat' => 53.608867,
);
}

View File

@@ -0,0 +1,51 @@
<?php
// Colombia
function location_province_list_co() {
return array('AMZ' => "Amazonas",
'ANT' => "Antioquia",
'ARA' => "Arauca",
'ATL' => "Atlantico",
'BOL' => "Bolivar",
'BOY' => "Boyaca",
'CAL' => "Caldas",
'CAQ' => "Caqueta",
'CAS' => "Casanare",
'CAU' => "Cauca",
'CES' => "Cesar",
'CHO' => "Choco",
'COR' => "Cordoba",
'CAM' => "Cundinamarca",
'GNA' => "Guainia",
'GJR' => "Guajira",
'GVR' => "Guaviare",
'HUI' => "Huila",
'MAG' => "Magdalena",
'MET' => "Meta",
'NAR' => "Narino",
'NDS' => "Norte de Santander",
'PUT' => "Putumayo",
'QUI' => "Quindio",
'RIS' => "Risaralda",
'SAP' => "San Andres y Providencia",
'SAN' => "Santander",
'SUC' => "Sucre",
'TOL' => "Tolima",
'VDC' => "Valle del Cauca",
'VAU' => "Vaupes",
'VIC' => "Vichada",
'BDC' => "Bogota D.C.");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_co() {
return array(
'minlng' => -81.8458,
'minlat' => -4.0608,
'maxlng' => -66.8912,
'maxlat' => 15.886067,
);
}

View File

@@ -0,0 +1,25 @@
<?php
// Costa Rica
function location_province_list_cr() {
return array('AL' => "Alajuela",
'CA' => "Cartago",
'GU' => "Guanacaste",
'HE' => "Heredia",
'LI' => "Limon",
'PU' => "Puntarenas",
'SJ' => "San Jose");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cr() {
return array(
'minlng' => -87.01515,
'minlat' => 5.4829,
'maxlng' => -82.6145,
'maxlat' => 11.217367,
);
}

View File

@@ -0,0 +1,10 @@
<?php
// Serbia and Montenegro
function location_province_list_cs() {
return array('KOS' => "Kosovo",
'MON' => "Montenegro",
'SER' => "Serbia",
'VOJ' => "Vojvodina");
}

View File

@@ -0,0 +1,33 @@
<?php
// Cuba
function location_province_list_cu() {
return array('IJU' => "Isla de la Juventud",
'PRI' => "Pinar del Rio",
'LHA' => "La Habana",
'CLH' => "Ciudad de La Habana",
'MAT' => "Matanzas",
'CFU' => "Cienfuegos",
'VCL' => "Villa Clara",
'SSP' => "Sancti Spiritus",
'CAV' => "Ciego de Avila",
'CAM' => "Camaguey",
'LTU' => "Las Tunas",
'GRA' => "Granma",
'HOL' => "Holguin",
'SCU' => "Santiago de Cuba",
'GUA' => "Guantanamo");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cu() {
return array(
'minlng' => -84.88225,
'minlat' => 19.796767,
'maxlng' => -74.10875,
'maxlat' => 23.263867,
);
}

View File

@@ -0,0 +1,35 @@
<?php
// Cape Verde
function location_province_list_cv() {
return array('BV' => "Boa Vista",
'BR' => "Brava",
'CS' => "Calheta de Sao Miguel",
'MA' => "Maio",
'MO' => "Mosteiros",
'PA' => "Paul",
'PN' => "Porto Novo",
'PR' => "Praia",
'RG' => "Ribeira Grande",
'SL' => "Sal",
'CA' => "Santa Catarina",
'CR' => "Santa Cruz",
'SD' => "Sao Domingos",
'SF' => "Sao Filipe",
'SN' => "Sao Nicolau",
'SV' => "Sao Vicente",
'TA' => "Tarrafal");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cv() {
return array(
'minlng' => -25.45625,
'minlat' => 14.702533,
'maxlng' => -22.55505,
'maxlat' => 17.15,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Christmas Island
function location_province_list_cx() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cx() {
return array(
'minlng' => 105.619,
'minlat' => -10.3823,
'maxlng' => 105.69085,
'maxlat' => -10.351733,
);
}

View File

@@ -0,0 +1,24 @@
<?php
// Cyprus
function location_province_list_cy() {
return array('F' => "Famagusta",
'K' => "Kyrenia",
'A' => "Larnaca",
'I' => "Limassol",
'N' => "Nicosia",
'P' => "Paphos");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cy() {
return array(
'minlng' => 32.196,
'minlat' => 34.596467,
'maxlng' => 34.5541,
'maxlat' => 35.748533,
);
}

View File

@@ -0,0 +1,32 @@
<?php
// Czech Republic
function location_province_list_cz() {
return array('JC' => "South Bohemian Region (Jihocesky kraj)",
'JM' => "South Moravian Region (Jihomoravsky kraj)",
'KA' => "Carlsbad Region (Karlovarsky kraj)",
'VY' => "Vysoc(ina Region (kraj Vysoc(ina)",
'KR' => "Hradec Kralove Region (Kralovehradecky kraj)",
'LI' => "Liberec Region (Liberecky kraj)",
'MO' => "Moravian-Silesian Region (Moravskoslezsky kraj)",
'OL' => "Olomouc Region (Olomoucky kraj)",
'PA' => "Pardubice Region (Pardubicky kraj)",
'PL' => "Plzen( Region Plzensky kraj)",
'PR' => "Prague - the Capital (Praha - hlavni mesto)",
'ST' => "Central Bohemian Region (Stredocesky kraj)",
'US' => "Usti nad Labem Region (Ustecky kraj)",
'ZL' => "Zlin Region (Zlinsky kraj)");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_cz() {
return array(
'minlng' => 12.0978,
'minlat' => 48.5857,
'maxlng' => 18.90825,
'maxlat' => 51.041333,
);
}

View File

@@ -0,0 +1,269 @@
<?php
function location_province_list_de() {
return array(
'BB' => 'Brandenburg',
'BE' => 'Berlin',
'BW' => 'Baden-Württemberg',
'BY' => 'Bayern',
'HB' => 'Bremen',
'HE' => 'Hessen',
'HH' => 'Hamburg',
'MV' => 'Mecklenburg-Vorpommern',
'NI' => 'Niedersachsen',
'NW' => 'Nordrhein-Westfalen',
'RP' => 'Rheinland-Pfalz',
'SH' => 'Schleswig-Holstein',
'SL' => 'Saarland',
'SN' => 'Sachsen',
'ST' => 'Sachsen-Anhalt',
'TH' => 'Thüringen'
);
}
/**
* Parameters:
* -> $location_a is an associative array that represents a full location where
* 'street' => the street portions of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* -> $location_b is associative array that represents a full location in the same way that
* parameter $location_b does.
*
* Returns: a link to driving directions
*/
function location_map_link_de($location = array(), $hide = array()) {
$map_links = array();
// For now, just call the suchen (tinfo) function. May want to make this configurable on some level
// in order to maintain freedom of choice so users and site-admins don't have to be slaves
// to tinfo!.... not that I have anything personal against tinfo!.
if ($link = _location_map_link_de_suchen($location)) {
$map_links['suchen'] = $link;
}
return $map_links;
}
function _location_map_link_de_suchen($location = array()) {
$get_query = '?';
$get_query .= 'where=';
$query_parts = array();
if (isset($location['street'])) {
$query_parts[] = $location['street'];
}
if ($location['postal_code'] != '') {
$query_parts[] = $location['postal_code'];
}
if ($location['city'] != '') {
$query_parts[] = $location['city'];
}
// if ($location['number'] != '') {
// $query_parts[] = $location['number'];
// }
$get_query .= urlencode(implode(', ', $query_parts));
return ('http://www.suchen.de/lokalmap'. $get_query);
}
function location_map_link_de_providers() {
return array(
'suchen' => array(
'name' => 'suchen.de (T-Info)',
'url' => 'http://www.suchen.de/',
'tos' => 'http://www.suchen.de/agb',
),
'google' => array(
'name' => 'Google Maps',
'url' => 'http://maps.google.com',
'tos' => 'http://www.google.com/help/terms_local.html',
),
);
}
function location_map_link_de_default_providers() {
return array('google');
}
/**
* Parameters:
* -> $location_a is an associative array that represents a full location where
* 'street' => the street portions of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* -> $location_b is associative array that represents a full location in the same way that
* parameter $location_b does.
*
* Returns: a link to driving directions
*
* For now, assume site-admin wants driving directions linked to tinfo!
* Maybe later, we can add some kind of country-specific settings page that allows the site-admin to
* decide which site to link to for driving directions.
*/
function location_driving_directions_link_de($location_a, $location_b) {
return _location_driving_directions_link_de_suchen($location_a, $location_b);
}
/**
* Parameters:
* Function that is called by location_driving_directions_link_ca() under assumption that it
* is the chosen function
*
* Returns:
* a URL with HTTP GET variables
* Depending on how full the locationes are, the URL will either point to the driving directions
* on tinfo! or, if only partial locationes are provided, a URL that points to the *form* for
* tinfo! driving directions where the form is filled with whatever fields have been provided
* for the partial location(es).
*/
function _location_driving_directions_link_de_suchen($location_a, $location_b) {
foreach ($location_a as $field => $value) {
$location_a[$field] = trim($value);
}
foreach ($location_b as $field => $value) {
$location_b[$field] = trim($value);
}
if ($location_a['country'] == 'de' and $location_b['country'] == 'de') {
$get_query = '?';
// VON
$query_parts = array();
if (isset($location_a['street'])) {
$query_parts[] = $location_a['street'];
}
if ($location_a['postal_code'] != '') {
$query_parts[] = $location_a['postal_code'];
}
if ($location_a['city'] != '') {
$query_parts[] = $location_a['city'];
}
$get_query .= 'route_from='. urlencode(implode(', ', $query_parts));
// NACH
$query_parts = array();
if (isset($location_b['street'])) {
$query_parts[] = $location_b['street'];
}
if ($location_b['postal_code'] != '') {
$query_parts[] = $location_b['postal_code'];
}
if ($location_b['city'] != '') {
$query_parts[] = $location_b['city'];
}
$get_query .= '&amp;route_to='. urlencode(implode(', ', $query_parts));
return ('http://www.suchen.de/route'. $get_query);
}
}
function location_map_link_de_google($location = array()) {
$query_params = array();
foreach (array('street', 'postal_code', 'city', 'country') as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (count($query_params)) {
return ('http://maps.google.com?q='. urlencode(implode(', ', $query_params)));
}
else {
return NULL;
}
}
function theme_location_de($location = array(), $hide = array()) {
$output = '';
if (count($location)) {
$output .= "\n";
$output .= '<div class="location vcard"><div class="adr">'."\n";
if (!empty($location['name']) && !in_array('name', $hide)) {
$output .= '<div class="fn">'. $location['name'] .'</div>';
}
if (!empty($location['street']) && !in_array('street', $hide)) {
$output .= '<div class="street-address">'. $location['street'];
if (!empty($location['additional']) && !in_array('street', $hide)) {
$output .= ' '. $location['additional'];
}
$output .='</div>';
}
if ((!empty($location['city']) && !in_array('city', $hide)) ||
(!empty($location['postal_codet']) && !in_array('postal_code', $hide))) {
$city_postal = array();
if (!empty($location['postal_code']) && !in_array('postal_code', $hide)) {
$city_postal[] = '<span class="postal-code">'. $location['postal_code'] .'</span>';
}
if (!empty($location['city']) && !in_array('city', $hide)) {
$city_postal[] = '<span class="locality">'. $location['city'] .'</span>';
}
$output .= '<div>'. implode(' ', $city_postal) .'</div>';
}
if (!in_array('country', $hide)) {
$output .= '<div class="country-name">'. t('Germany') .'</div>';
}
if (location_has_coordinates($location)) {
$output .= '<div class="geo"><abbr class="latitude" title="'. $location['latitude'] .'" /><abbr class="longitude" title="'. $location['latitude'] .'" /></div>';
}
$output .= '</div></div>';
}
return $output;
}
/**
* Returns a lat/lon pair of the approximate center of the given postal code in the given country
*
* @param $location
* An associative array $location where only postal code and country are necessary, but can have the keys:
* 'street' => the street portion of the location
* 'supplemental' => additional street portion of the location
* 'province' => the province, state, or territory
* 'country' => lower-cased two-letter ISO code (REQUIRED)
* 'postal_code' => the international postal code for this location (REQUIRED)
*
* @return
* An associative array where
* 'lat' => approximate latitude of the center of the postal code's area
* 'lon' => approximate longitude of the center of the postal code's area
*
*/
function location_get_postalcode_data_de($location = array()) {
$dash_index = strpos($location['postal_code'], '-');
// First we strip slash off if we're dealing with a 9-digit US zipcode
if ($dash_index === FALSE) {
$location['postal_code'] = substr($location['postal_code'], 0, $dash_index);
}
// Now we pad the thing and query.
$row = db_query("SELECT * FROM {zipcodes} where country = :country AND zip = :zip", array(':country' => $location['country'], ':zip' => str_pad($location['postal_code'], 5, "0", STR_PAD_LEFT)))->fetchObject();
if ($row) {
return array('lat' => $row->latitude, 'lon' => $row->longitude, 'city' => $row->city, 'province' => $row->state, 'country' => $row->country);
}
else {
return NULL;
}
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_de() {
return array(
'minlng' => 5.87225,
'minlat' => 47.2249,
'maxlng' => 15.04765,
'maxlat' => 55.0839,
);
}

View File

@@ -0,0 +1,23 @@
<?php
// Djibouti
function location_province_list_dj() {
return array('S' => "'Ali Sabih",
'K' => "Dikhil",
'J' => "Djibouti",
'O' => "Obock",
'T' => "Tadjoura");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_dj() {
return array(
'minlng' => 41.7834,
'minlat' => 10.874833,
'maxlng' => 43.4419,
'maxlat' => 12.718233,
);
}

View File

@@ -0,0 +1,142 @@
<?php
// Denmark
function location_province_list_dk() {
return array('CC' => "Copenhagen (municipality)",
'FC' => "Frederiksberg (municipality)",
'CO' => "Copenhagen",
'FR' => "Frederiksborg",
'RO' => "Roskilde",
'WZ' => "West Zealand",
'ST' => "Storstrom",
'FU' => "Funen",
'SJ' => "South Jutland",
'RB' => "Ribe",
'VK' => "Vejle",
'RK' => "Ringkjobing",
'VB' => "Viborg",
'NJ' => "North Jutland",
'AR' => "Arhus",
'BH' => "Bornholm",
'GL' => "Greenland",
'FO' => "Faroe Islands");
}
/**
* Generate findvej.dk map link.
*
* @param array $location
* The location array we're trying to generate a link for.
* @return string or null
* Map link if generation successful, otherwise null.
*/
function location_map_link_dk_findvej($location = array()) {
if (isset($location['street']) && !empty($location['street']) &&
isset($location['postal_code']) && !empty($location['postal_code'])) {
return url('http://findvej.dk/' . $location['street'] . ',' . $location['postal_code']);
}
elseif (isset($location['street']) && !empty($location['street']) &&
isset($location['city']) && !empty($location['city'])) {
return url('http://findvej.dk/' . $location['street'] . ',' . $location['city']);
}
elseif (location_has_coordinates($location)) {
return url('http://findvej.dk/', array('query' => array(
'latitude' => $location['latitude'],
'longitude' => $location['longitude'],
)));
}
else {
return NULL;
}
}
/**
* Generate a link to Rejseplanen.
*
* Rejseplanen is a route planner for Danish public transportation.
*
* @param array $location
* The location array we're trying to generate a link for.
* @return string or null
* Map link if generation successful, otherwise null.
*/
function location_map_link_dk_rejseplanen($location = array()) {
$keys = array();
// Iterate over all the possible details, and if set, add them to an array.
foreach (array('street', 'postal_code', 'city') as $name) {
if (isset($location[$name]) && !empty($location[$name])) {
$keys[$name] = $location[$name];
}
}
// Merge postal code and city if both are available, since they
// shouldn't be comma separated in Danish addresses.
if (isset($keys['postal_code']) && isset($keys['city'])) {
$keys['postal_code'] = $keys['postal_code'] . ' ' . $keys['city'];
unset($keys['city']);
}
// If any of the key values were available, generate a URL.
if (!empty($keys)) {
return url('http://www.rejseplanen.dk/bin/query.exe/mn?Z=' . implode(', ', $keys) . '&ZADR=1');
}
else {
return NULL;
}
}
/**
* @return
* An array where
* -> the key is the word that helps identify the name of function that builds the link. For example, a key of 'yahoo' means the name of the
* the function that builds a link to a map on Yahoo! Maps would be 'location_map_link_us_yahoo'
* -> the value is itself an array with 3 key/value pairs:
* 'name' => points to the name of the mapping service. For 'yahoo', this would be 'Yahoo! Maps'
* 'url' => the url of the main page of the mapping service. For 'yahoo', this would be 'http://maps.yahoo.com'
* 'tos' => the url of the page that explains the map providers Terms of Service, or Terms of Use. For 'yahoo', this would be
* 'http://help.yahoo.com/help/us/maps/maps-24.html'
*/
function location_map_link_dk_providers() {
return array(
'findvej' => array(
'name' => 'findvej.dk',
'url' => 'http://findvej.dk',
'tos' => 'http://www.google.com/intl/da_ALL/help/terms_maps.html',
),
'rejseplanen' => array(
'name' => 'Rejseplanen',
'url' => 'http://www.rejseplanen.dk/',
'tos' => 'http://info.rejseplanen.dk/om_rejseplanen', // As close as I could find.
),
);
}
/**
* @return
* An array of values that work as keys to the array returned by location_map_link_us_providers. The idea is that if the
* administrator of the site has not yet had a chance to visit the "Map Links" subtab on the location module's settings page,
* that we can provide deep-linking to a relatively safe default. By 'relatively safe', we mean that the Terms Of Service of
* the provider of the maps are flexible enough for most parties.
*
* For the case of the U.S., 'google' has relatively flexible Terms Of Service, whereas Yahoo! Maps and MapQuest have more
* restrictive Terms Of Service.
*
*/
function location_map_link_dk_default_providers() {
return array('findvej', 'rejseplanen');
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_dk() {
return array(
'minlng' => 8.00875,
'minlat' => 54.590067,
'maxlng' => 15.15975,
'maxlat' => 57.805567,
);
}

View File

@@ -0,0 +1,28 @@
<?php
// Dominica
function location_province_list_dm() {
return array('AND' => "Saint Andrew Parish",
'DAV' => "Saint David Parish",
'GEO' => "Saint George Parish",
'JOH' => "Saint John Parish",
'JOS' => "Saint Joseph Parish",
'LUK' => "Saint Luke Parish",
'MAR' => "Saint Mark Parish",
'PAT' => "Saint Patrick Parish",
'PAU' => "Saint Paul Parish",
'PET' => "Saint Peter Parish");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_dm() {
return array(
'minlng' => -61.5093,
'minlat' => 15.237433,
'maxlng' => -61.20985,
'maxlat' => 15.627967,
);
}

View File

@@ -0,0 +1,50 @@
<?php
// Dominican Republic
function location_province_list_do() {
return array('DN' => "Distrito Nacional",
'AZ' => "Azua",
'BC' => "Baoruco",
'BH' => "Barahona",
'DJ' => "Dajabon",
'DU' => "Duarte",
'EL' => "Elias Pina",
'SY' => "El Seybo",
'ET' => "Espaillat",
'HM' => "Hato Mayor",
'IN' => "Independencia",
'AL' => "La Altagracia",
'RO' => "La Romana",
'VE' => "La Vega",
'MT' => "Maria Trinidad Sanchez",
'MN' => "Monsenor Nouel",
'MC' => "Monte Cristi",
'MP' => "Monte Plata",
'PD' => "Pedernales",
'PR' => "Peravia (Bani)",
'PP' => "Puerto Plata",
'SL' => "Salcedo",
'SM' => "Samana",
'SH' => "Sanchez Ramirez",
'SC' => "San Cristobal",
'JO' => "San Jose de Ocoa",
'SJ' => "San Juan",
'PM' => "San Pedro de Macoris",
'SA' => "Santiago",
'ST' => "Santiago Rodriguez",
'SD' => "Santo Domingo",
'VA' => "Valverde");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_do() {
return array(
'minlng' => -71.90115,
'minlat' => 17.506667,
'maxlng' => -68.2548,
'maxlat' => 19.880967,
);
}

View File

@@ -0,0 +1,66 @@
<?php
// Algeria
function location_province_list_dz() {
return array('ADR' => "Adrar",
'ADE' => "Ain Defla",
'ATE' => "Ain Temouchent",
'ALG' => "Alger",
'ANN' => "Annaba",
'BAT' => "Batna",
'BEC' => "Bechar",
'BEJ' => "Bejaia",
'BIS' => "Biskra",
'BLI' => "Blida",
'BBA' => "Bordj Bou Arreridj",
'BOA' => "Bouira",
'BMD' => "Boumerdes",
'CHL' => "Chlef",
'CON' => "Constantine",
'DJE' => "Djelfa",
'EBA' => "El Bayadh",
'EOU' => "El Oued",
'ETA' => "El Tarf",
'GHA' => "Ghardaia",
'GUE' => "Guelma",
'ILL' => "Illizi",
'JIJ' => "Jijel",
'KHE' => "Khenchela",
'LAG' => "Laghouat",
'MUA' => "Muaskar",
'MED' => "Medea",
'MIL' => "Mila",
'MOS' => "Mostaganem",
'MSI' => "M'Sila",
'NAA' => "Naama",
'ORA' => "Oran",
'OUA' => "Ouargla",
'OEB' => "Oum el-Bouaghi",
'REL' => "Relizane",
'SAI' => "Saida",
'SET' => "Setif",
'SBA' => "Sidi Bel Abbes",
'SKI' => "Skikda",
'SAH' => "Souk Ahras",
'TAM' => "Tamanghasset",
'TEB' => "Tebessa",
'TIA' => "Tiaret",
'TIN' => "Tindouf",
'TIP' => "Tipaza",
'TIS' => "Tissemsilt",
'TOU' => "Tizi Ouzou",
'TLE' => "Tlemcen");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_dz() {
return array(
'minlng' => -8.69675,
'minlat' => 18.852433,
'maxlng' => 11.96305,
'maxlat' => 37.025967,
);
}

View File

@@ -0,0 +1,40 @@
<?php
// Ecuador
function location_province_list_ec() {
return array('A' => "Azuay",
'B' => "Bolivar",
'C' => "Carchi",
'D' => "Orellana",
'E' => "Esmeraldas",
'F' => "Canar",
'G' => "Guayas",
'H' => "Chimborazo",
'I' => "Imbabura",
'L' => "Loja",
'M' => "Manabi",
'N' => "Napo",
'O' => "El Oro",
'P' => "Pichincha",
'R' => "Los Rios",
'S' => "Morona-Santiago",
'T' => "Tungurahua",
'U' => "Sucumbios",
'W' => "Galapagos",
'X' => "Cotopaxi",
'Y' => "Pastaza",
'Z' => "Zamora-Chinchipe");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ec() {
return array(
'minlng' => -92.0364,
'minlat' => -4.891367,
'maxlng' => -75.23925,
'maxlat' => 1.715733,
);
}

View File

@@ -0,0 +1,33 @@
<?php
// Estonia
function location_province_list_ee() {
return array('37' => "Harju County",
'39' => "Hiiu County",
'44' => "Ida-Viru County",
'49' => "Jõgeva County",
'51' => "Järva County",
'57' => "Lääne County",
'59' => "Lääne-Viru County",
'65' => "Põlva County",
'67' => "Pärnu County",
'70' => "Rapla County",
'74' => "Saare County",
'78' => "Tartu County",
'82' => "Valga County",
'84' => "Viljandi County",
'86' => "Võru County");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ee() {
return array(
'minlng' => 21.75065,
'minlat' => 57.6099,
'maxlng' => 28.1741,
'maxlat' => 59.6835,
);
}

View File

@@ -0,0 +1,44 @@
<?php
// Egypt
function location_province_list_eg() {
return array('DHY' => "Ad Daqahliyah",
'BAM' => "Al Bahr al Ahmar",
'BHY' => "Al Buhayrah",
'FYM' => "Al Fayyum",
'GBY' => "Al Gharbiyah",
'IDR' => "Al Iskandariyah",
'IML' => "Al Isma'iliyah",
'JZH' => "Al Jizah",
'MFY' => "Al Minufiyah",
'MNY' => "Al Minya",
'QHR' => "Al Qahirah",
'QLY' => "Al Qalyubiyah",
'WJD' => "Al Wadi al Jadid",
'SHQ' => "Ash Sharqiyah",
'SWY' => "As Suways",
'ASW' => "Aswan",
'ASY' => "Asyut",
'BSW' => "Bani Suwayf",
'BSD' => "Bur Sa'id",
'DMY' => "Dumyat",
'JNS' => "Janub Sina'",
'KSH' => "Kafr ash Shaykh",
'MAT' => "Matruh",
'QIN' => "Qina",
'SHS' => "Shamal Sina'",
'SUH' => "Suhaj");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_eg() {
return array(
'minlng' => 24.78595,
'minlat' => 22.008123,
'maxlng' => 36.88215,
'maxlat' => 31.746867,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Western Sahara
function location_province_list_eh() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_eh() {
return array(
'minlng' => -17.08725,
'minlat' => 20.761433,
'maxlng' => -8.6836,
'maxlat' => 27.654567,
);
}

View File

@@ -0,0 +1,26 @@
<?php
// Eritrea
function location_province_list_er() {
return array(
'MA' => "Central (Maekel)",
'KE' => "Anseba (Keren)",
'DK' => "Southern Red Sea (Debub-Keih-Bahri)",
'SK' => "Northern Red Sea (Semien-Keih-Bahri)",
'DE' => "Southern (Debub)",
'BR' => "Gash-Barka (Barentu)",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_er() {
return array(
'minlng' => 36.3629,
'minlat' => 12.344214,
'maxlng' => 43.0529,
'maxlat' => 18.039133,
);
}

View File

@@ -0,0 +1,68 @@
<?php
// Spain
function location_province_list_es() {
return array('AL' => "Alava",
'AB' => "Albacete",
'AC' => "Alicante",
'AM' => "Almeria",
'AS' => "Asturias",
'AV' => "Avila",
'BJ' => "Badajoz",
'IB' => "Illes Balears",
'BA' => "Barcelona",
'BU' => "Burgos",
'CC' => "Caceres",
'CZ' => "Cadiz",
'CT' => "Cantabria",
'CL' => "Castellon",
'CR' => "Ciudad Real",
'CD' => "Cordoba",
'CA' => "A Coruna",
'CU' => "Cuenca",
'GI' => "Girona",
'GD' => "Granada",
'GJ' => "Guadalajara",
'GP' => "Guipuzcoa",
'HL' => "Huelva",
'HS' => "Huesca",
'JN' => "Jaen",
'RJ' => "La Rioja",
'LE' => "Leon",
'LL' => "Lleida",
'LG' => "Lugo",
'MD' => "Madrid",
'ML' => "Malaga",
'MU' => "Murcia",
'NV' => "Navarra",
'OU' => "Ourense",
'PL' => "Palencia",
'PM' => "Las Palmas",
'PO' => "Pontevedra",
'SL' => "Salamanca",
'SC' => "Santa Cruz de Tererife",
'SG' => "Segovia",
'SV' => "Sevilla",
'SO' => "Soria",
'TA' => "Tarragona",
'TE' => "Teruel",
'TO' => "Toledo",
'VC' => "Valencia",
'VD' => "Valladolid",
'VZ' => "Vizcaya",
'ZM' => "Zamora",
'ZR' => "Zaragoza");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_es() {
return array(
'minlng' => -18.26745,
'minlat' => 27.5218,
'maxlng' => 4.2802,
'maxlat' => 43.739867,
);
}

View File

@@ -0,0 +1,29 @@
<?php
// Ethiopia
function location_province_list_et() {
return array('AF' => "Afar",
'AH' => "Amhara",
'BG' => "Benishangul-Gumaz",
'GB' => "Gambela",
'HR' => "Hariai",
'OR' => "Oromia",
'SM' => "Somali",
'SN' => "Southern Nations - Nationalities and Peoples Region",
'TG' => "Tigray",
'AA' => "Addis Ababa",
'DD' => "Dire Dawa");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_et() {
return array(
'minlng' => 33.0563,
'minlat' => 3.550567,
'maxlng' => 47.97805,
'maxlat' => 19.896167,
);
}

View File

@@ -0,0 +1,24 @@
<?php
// Finland
function location_province_list_fi() {
return array('ES' => "Etela-Suomen laani",
'LS' => "Lansi-Suomen laani",
'IS' => "Ita-Suomen laani",
'OU' => "Oulun laani",
'LL' => "Lapin laani",
'AH' => "Ahvenanmaan laani");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_fi() {
return array(
'minlng' => 19.45165,
'minlat' => 59.806267,
'maxlng' => 31.42675,
'maxlat' => 70.137467,
);
}

View File

@@ -0,0 +1,23 @@
<?php
// Fiji
function location_province_list_fj() {
return array('C' => "Central Division",
'N' => "Northern Division",
'E' => "Eastern Division",
'W' => "Western Division",
'R' => "Rotuma");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_fj() {
return array(
'minlng' => -180,
'minlat' => -21.808767,
'maxlng' => 180,
'maxlat' => -15.7846,
);
}

View File

@@ -0,0 +1,21 @@
<?php
// Falkland Islands (Malvinas)
function location_province_list_fk() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_fk() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => -61.317441,
'minlat' => -52.341765,
'maxlng' => -57.733603,
'maxlat' => -51.027736,
);
}

View File

@@ -0,0 +1,26 @@
<?php
// Micronesia, Federated States of
function location_province_list_fm() {
return array(
'C' => "Chuuk",
'K' => "Kosrae",
'P' => "Pohnpei",
'Y' => "Yap",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_fm() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => 138.064058,
'minlat' => 5.26970530,
'maxlng' => 163.046770,
'maxlat' => 9.58869232,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Faroe Islands
function location_province_list_fo() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_fo() {
return array(
'minlng' => -7.71855,
'minlat' => 61.392267,
'maxlng' => -6.3104,
'maxlat' => 62.419167,
);
}

View File

@@ -0,0 +1,70 @@
<?php
// France
function location_province_list_fr() {
return array(
'A67' => "Bas-Rhin - Alsace",
'A68' => "Haut-Rhin - Alsace",
'B24' => "Dordogne - Aquitaine",
'B33' => "Gironde - Aquitaine",
'B40' => "Landes - Aquitaine",
'B47' => "Lot-et-Garonne - Aquitaine",
'B64' => "Pyrenees-Atlantiques - Aquitaine",
'B79' => "Deux-Sevres - Aquitaine",
'C03' => "Allier - Auvergne",
'C15' => "Cantal - Auvergne",
'C43' => "Haute-Loire - Auvergne",
'C63' => "Pu-de-Dme - Auvergne",
'D21' => "Cote-d'Or - Bourgogne",
'D58' => "Nievre - Bourgogne",
'D71' => "Saone-et-Loire - Bourgogne",
'D89' => "Yonne - Bourgogne",
'E22' => "Cotes-d'Armor - Bretagne",
'E29' => "Finistere - Bretagne",
'E35' => "Ille-et-Vilaine - Bretagne",
'E56' => "Morbihan - Bretagne",
'F18' => "Cher - Centre",
'F28' => "Eure-et-Loir - Centre",
'F36' => "Indre - Centre",
'F37' => "Indre-et-Loire - Centre",
'F41' => "Loir-et-Cher - Centre",
'F45' => "Loiret - Centre",
'G08' => "Ardennes - Champagne-Ardenne",
'G10' => "Aube - Champagne-Ardenne",
'G51' => "Marne - Champagne-Ardenne",
'G52' => "Haute-Marne - Champagne-Ardenne",
'H2A' => "Corse-du-Sud - Corse",
'H2B' => "Haute-Corse - Corse",
'I25' => "Doubs - Franche-Comte",
'I39' => "Jura - Franche-Comte",
'I70' => "Haute-Saone - Franche-Comte",
'I90' => "Haute-Saone - Territoire de Belfort",
'J75' => "Paris - Ile-de-France",
'J77' => "Seine-et-Marne - Ile-de-France",
'J78' => "Yvelines - Ile-de-France",
'J91' => "Essonne - Ile-de-France",
'J92' => "Hauts-de-Seine - Ile-de-France",
'J93' => "Seine-Saint-Denis - Ile-de-France",
'J94' => "Val-de-Marne - Ile-de-France",
'J95' => "Val-d'Oise - Ile-de-France",
'U04' => "Alpes-de-Haute-Provence - Provence-Alpes-Cote d'Azur",
'U05' => "Hautes-Alpes - Provence-Alpes-Cote d'Azur",
'U06' => "Alpes-Maritimes - Provence-Alpes-Cote d'Azur",
'U13' => "Bouches-du-Rhone - Provence-Alpes-Cote d'Azur",
'U83' => "Var - Provence-Alpes-Cote d'Azur",
'U84' => "Vaucluse - Provence-Alpes-Cote d'Azur",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_fr() {
return array(
'minlng' => -176.3726,
'minlat' => -27.946767,
'maxlng' => 172.15695,
'maxlat' => 51.122333,
);
}

View File

@@ -0,0 +1,27 @@
<?php
// Gabon
function location_province_list_ga() {
return array('ES' => "Estuaire",
'HO' => "Haut-Ogooue",
'MO' => "Moyen-Ogooue",
'NG' => "Ngounie",
'NY' => "Nyanga",
'OI' => "Ogooue-Ivindo",
'OL' => "Ogooue-Lolo",
'OM' => "Ogooue-Maritime",
'WN' => "Woleu-Ntem");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ga() {
return array(
'minlng' => 8.59375,
'minlat' => -3.9324,
'maxlng' => 14.72285,
'maxlat' => 2.299667,
);
}

View File

@@ -0,0 +1,286 @@
<?php
// Great Britain
function location_province_list_gb() {
return array(
'GSY' => "Guernsey",
'JSY' => "Jersey",
'BDG' => "Barking and Dagenham",
'BNE' => "Barnet",
'BNS' => "Barnsley",
'BAS' => "Bath and North East Somerset",
'BDF' => "Bedfordshire",
'BEX' => "Bexley",
'BIR' => "Birmingham",
'BBD' => "Blackburn with Darwen",
'BPL' => "Blackpool",
'BOL' => "Bolton",
'BMH' => "Bournemouth",
'BRC' => "Bracknell Forest",
'BRD' => "Bradford",
'BEN' => "Brent",
'BNH' => "Brighton and Hove",
'BST' => "Bristol City of",
'BRY' => "Bromley",
'BKM' => "Buckinghamshire",
'BUR' => "Bury",
'CLD' => "Calderdale",
'CAM' => "Cambridgeshire",
'CMD' => "Camden",
'CHS' => "Cheshire",
'CON' => "Cornwall",
'COV' => "Coventry (West Midlands district)",
'CRY' => "Croydon",
'CMA' => "Cumbria",
'DAL' => "Darlington",
'DER' => "Derby",
'DBY' => "Derbyshire",
'DEV' => "Devon",
'DNC' => "Doncaster",
'DOR' => "Dorset",
'DUD' => "Dudley (West Midlands district)",
'DUR' => "Durham",
'EAL' => "Ealing",
'ERY' => "East Riding of Yorkshire",
'ESX' => "East Sussex",
'ENF' => "Enfield",
'ESS' => "Essex",
'GAT' => "Gateshead (Tyne & Wear district)",
'GLS' => "Gloucestershire",
'GRE' => "Greenwich",
'HCK' => "Hackney",
'HAL' => "Halton",
'HMF' => "Hammersmith and Fulham",
'HAM' => "Hampshire",
'HRY' => "Haringey",
'HRW' => "Harrow",
'HPL' => "Hartlepool",
'HAV' => "Havering",
'HEF' => "Herefordshire County of",
'HRT' => "Hertfordshire",
'HIL' => "Hillingdon",
'HNS' => "Hounslow",
'IOW' => "Isle of Wight",
'IOS' => "Isles of Scilly",
'ISL' => "Islington",
'KEC' => "Kensington and Chelsea",
'KEN' => "Kent",
'KHL' => "Kingston upon Hull City of",
'KTT' => "Kingston upon Thames",
'KIR' => "Kirklees",
'KWL' => "Knowsley",
'LBH' => "Lambeth",
'LAN' => "Lancashire",
'LDS' => "Leeds",
'LCE' => "Leicester",
'LEC' => "Leicestershire",
'LEW' => "Lewisham",
'LIN' => "Lincolnshire",
'LIV' => "Liverpool",
'LND' => "London City of",
'LUT' => "Luton",
'MAN' => "Manchester",
'MDW' => "Medway",
'MRT' => "Merton",
'MDB' => "Middlesbrough",
'MIK' => "Milton Keynes",
'NET' => "Newcastle upon Tyne",
'NWM' => "Newham",
'NFK' => "Norfolk",
'NEL' => "North East Lincolnshire",
'NLN' => "North Lincolnshire",
'NSM' => "North Somerset",
'NTY' => "North Tyneside",
'NYK' => "North Yorkshire",
'NTH' => "Northamptonshire",
'NBL' => "Northumberland",
'NGM' => "Nottingham",
'NTT' => "Nottinghamshire",
'OLD' => "Oldham",
'OXF' => "Oxfordshire",
'PTE' => "Peterborough",
'PLY' => "Plymouth",
'POL' => "Poole",
'POR' => "Portsmouth",
'RDG' => "Reading",
'RDB' => "Redbridge",
'RCC' => "Redcar and Cleveland",
'RIC' => "Richmond upon Thames",
'RCH' => "Rochdale",
'ROT' => "Rotherham",
'RUT' => "Rutland",
'SHN' => "St Helens",
'SLF' => "Salford",
'SAW' => "Sandwell",
'SFT' => "Sefton",
'SHF' => "Sheffield",
'SHR' => "Shropshire",
'SLG' => "Slough",
'SOL' => "Solihull",
'SOM' => "Somerset",
'SGC' => "South Gloucestershire",
'STY' => "South Tyneside",
'STH' => "Southampton",
'SOS' => "Southend-on-Sea",
'SWK' => "Southwark",
'STS' => "Staffordshire",
'SKP' => "Stockport",
'STT' => "Stockton-on-Tees",
'STE' => "Stoke-on-Trent",
'SFK' => "Suffolk",
'SND' => "Sunderland",
'SRY' => "Surrey",
'STN' => "Sutton",
'SWD' => "Swindon",
'TAM' => "Tameside",
'TFW' => "Telford and Wrekin",
'THR' => "Thurrock",
'TOB' => "Torbay",
'TWH' => "Tower Hamlets",
'TRF' => "Trafford",
'WKF' => "Wakefield",
'WLL' => "Walsall",
'WFT' => "Waltham Forest",
'WND' => "Wandsworth",
'WRT' => "Warrington",
'WAR' => "Warwickshire",
'WBK' => "West Berkshire",
'WSX' => "West Sussex",
'WSM' => "Westminster",
'WGN' => "Wigan",
'WIL' => "Wiltshire",
'WNM' => "Windsor and Maidenhead",
'WRL' => "Wirral",
'WOK' => "Wokingham",
'WLV' => "Wolverhampton",
'WOR' => "Worcestershire",
'YOR' => "York",
'ANT' => "Antrim",
'ARD' => "Ards",
'ARM' => "Armagh",
'BLA' => "Ballymena",
'BLY' => "Ballymoney",
'BNB' => "Banbridge",
'BFS' => "Belfast",
'CKF' => "Carrickfergus",
'CSR' => "Castlereagh",
'CLR' => "Coleraine",
'CKT' => "Cookstown",
'CGV' => "Craigavon",
'DRY' => "Derry",
'DOW' => "Down",
'DGN' => "Dungannon and South Tyrone",
'FER' => "Fermanagh",
'LRN' => "Larne",
'LMV' => "Limavady",
'LSB' => "Lisburn",
'MFT' => "Magherafelt",
'MYL' => "Moyle",
'NYM' => "Newry and Mourne",
'NTA' => "Newtownabbey",
'NDN' => "North Down",
'OMH' => "Omagh",
'STB' => "Strabane",
'ABE' => "Aberdeen",
'ABD' => "Aberdeenshire",
'ANS' => "Angus",
'AGB' => "Argyll and Bute",
'CLK' => "Clackmannanshire",
'DGY' => "Dumfries and Galloway",
'DND' => "Dundee",
'EAY' => "East Ayrshire",
'EDU' => "East Dunbartonshire",
'ELN' => "East Lothian",
'ERW' => "East Renfrewshire",
'EDH' => "Edinburgh",
'ELS' => "Eilean Siar",
'FAL' => "Falkirk",
'FIF' => "Fife",
'GLG' => "Glasgow",
'HLD' => "Highland",
'IVC' => "Inverclyde",
'NAY' => "North Ayrshire",
'NLK' => "North Lanarkshire",
'ORK' => "Orkney Islands",
'PKN' => "Perth and Kinross",
'MLN' => "Midlothian",
'MRY' => "Moray",
'RFW' => "Renfrewshire",
'SCB' => "Scottish Borders The",
'ZET' => "Shetland Islands",
'SAY' => "South Ayrshire",
'SLK' => "South Lanarkshire",
'STG' => "Stirling",
'WDU' => "West Dunbartonshire",
'WLN' => "West Lothian",
'BGW' => "Blaenau Gwent",
'BGE' => "Bridgend",
'CAY' => "Caerphilly",
'CRF' => "Cardiff",
'CMN' => "Carmarthenshire",
'CGN' => "Ceredigion",
'CWY' => "Conwy",
'DEN' => "Denbighshire",
'FLN' => "Flintshire",
'GWN' => "Gwynedd",
'AGY' => "Isle of Anglesey",
'MTY' => "Merthyr Tydfil",
'MON' => "Monmouthshire",
'NTL' => "Neath Port Talbot",
'NWP' => "Newport",
'PEM' => "Pembrokeshire",
'POW' => "Powys",
'RCT' => "Rhondda Cynon Taf",
'SWA' => "Swansea",
'TOF' => "Torfaen",
'VGL' => "Vale of Glamorgan",
'WRX' => "Wrexham",
);
}
function location_map_link_gb_providers() {
return array(
'google' => array(
'name' => 'Google Maps',
'url' => 'http://maps.google.co.uk',
'tos' => 'http://www.google.co.uk/help/terms_maps.html',
),
);
}
function location_map_link_gb_default_providers() {
return array('google');
}
function location_map_link_gb_google($location = array()) {
$query_params = array();
foreach (array('street', 'city', 'postal_code', 'country') as $field) {
if (isset($location[$field])) {
$query_params[] = $location[$field];
}
}
if (count($query_params)) {
return ('http://maps.google.co.uk?q='. urlencode(implode(', ', $query_params)));
}
else {
return NULL;
}
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gb() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
// From ISO code GB.
return array(
'minlng' => -13.691355,
'minlat' => 49.9096161,
'maxlng' => 1.77170536,
'maxlat' => 60.8475532,
);
}

View File

@@ -0,0 +1,26 @@
<?php
// Grenada
function location_province_list_gd() {
return array('A' => "Saint Andrew",
'D' => "Saint David",
'G' => "Saint George",
'J' => "Saint John",
'M' => "Saint Mark",
'P' => "Saint Patrick",
'C' => "Carriacou",
'Q' => "Petit Martinique");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gd() {
return array(
'minlng' => -61.839279,
'minlat' => 11.956733,
'maxlng' => -61.59945,
'maxlat' => 12.179133,
);
}

View File

@@ -0,0 +1,30 @@
<?php
// Georgia
function location_province_list_ge() {
return array('AB' => "Abkhazia",
'AJ' => "Ajaria",
'TB' => "Tbilisi",
'GU' => "Guria",
'IM' => "Imereti",
'KA' => "Kakheti",
'KK' => "Kvemo Kartli",
'MM' => "Mtskheta-Mtianeti",
'RL' => "Racha Lechkhumi and Kvemo Svaneti",
'SZ' => "Samegrelo-Zemo Svaneti",
'SJ' => "Samtskhe-Javakheti",
'SK' => "Shida Kartli");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ge() {
return array(
'minlng' => 39.923261,
'minlat' => 41.1446,
'maxlng' => 46.7882,
'maxlat' => 43.6354,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// French Guiana
function location_province_list_gf() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gf() {
return array(
'minlng' => -54.54515,
'minlat' => 1.999333,
'maxlng' => -51.7183,
'maxlat' => 5.779333,
);
}

View File

@@ -0,0 +1,37 @@
<?php
// Guernsey
// See http://www.statoids.com/ugg.html
function location_province_list_gg() {
return array(
'AL' => 'Alderney',
'BQ' => 'Brecqhou',
'CA' => 'Castel',
'FO' => 'Forest',
'HM' => 'Herm',
'JT' => 'Jethou',
'LH' => 'Lihou',
'AN' => 'Saint Andrew',
'MA' => 'Saint Martin',
'PP' => 'Saint Peter Port',
'PB' => 'Saint Pierre du Bois',
'SM' => 'Saint Sampson',
'SV' => 'Saint Saviour',
'SK' => 'Sark',
'TV' => 'Torteval',
'VA' => 'Vale',
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gg() {
return array(
'minlng' => -2.77195,
'minlat' => 49.381867,
'maxlng' => -2.3856,
'maxlat' => 49.4828,
);
}

View File

@@ -0,0 +1,28 @@
<?php
// Ghana
function location_province_list_gh() {
return array('AS' => "Ashanti Region",
'BA' => "Brong-Ahafo Region",
'CE' => "Central Region",
'EA' => "Eastern Region",
'GA' => "Greater Accra Region",
'NO' => "Northern Region",
'UE' => "Upper East Region",
'UW' => "Upper West Region",
'VO' => "Volta Region",
'WE' => "Western Region");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gh() {
return array(
'minlng' => -3.3352,
'minlat' => 4.678367,
'maxlng' => 1.25875,
'maxlat' => 11.169167,
);
}

View File

@@ -0,0 +1,21 @@
<?php
// Gibraltar
function location_province_list_gi() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gi() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => -5.3851187,
'minlat' => 36.1111819,
'maxlng' => -5.3587637,
'maxlat' => 36.1411025,
);
}

View File

@@ -0,0 +1,21 @@
<?php
// Greenland
function location_province_list_gl() {
return array('A' => "Avannaa",
'T' => "Tunu",
'K' => "Kitaa");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gl() {
return array(
'minlng' => -73.39145,
'minlat' => 59.7644,
'maxlng' => -11.72105,
'maxlat' => 83.674733,
);
}

View File

@@ -0,0 +1,31 @@
<?php
// Gambia
function location_province_list_gm() {
return array('BJ' => "Banjul",
'BS' => "Basse",
'BR' => "Brikama",
'JA' => "Janjangbure",
'KA' => "Kanifeng",
'KE' => "Kerewan",
'KU' => "Kuntaur",
'MA' => "Mansakonko",
'LR' => "Lower River",
'CR' => "Central River",
'NB' => "North Bank",
'UR' => "Upper River",
'WE' => "Western");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gm() {
return array(
'minlng' => -16.79745,
'minlat' => 13.105767,
'maxlng' => -13.8271,
'maxlat' => 13.7983,
);
}

View File

@@ -0,0 +1,52 @@
<?php
// Guinea
function location_province_list_gn() {
return array('CNK' => "Conakry",
'BYL' => "Beyla",
'BFA' => "Boffa",
'BOK' => "Boke",
'COY' => "Coyah",
'DBL' => "Dabola",
'DLB' => "Dalaba",
'DGR' => "Dinguiraye",
'DBR' => "Dubreka",
'FRN' => "Faranah",
'FRC' => "Forecariah",
'FRI' => "Fria",
'GAO' => "Gaoual",
'GCD' => "Gueckedou",
'KNK' => "Kankan",
'KRN' => "Kerouane",
'KND' => "Kindia",
'KSD' => "Kissidougou",
'KBA' => "Koubia",
'KDA' => "Koundara",
'KRA' => "Kouroussa",
'LAB' => "Labe",
'LLM' => "Lelouma",
'LOL' => "Lola",
'MCT' => "Macenta",
'MAL' => "Mali",
'MAM' => "Mamou",
'MAN' => "Mandiana",
'NZR' => "Nzerekore",
'PIT' => "Pita",
'SIG' => "Siguiri",
'TLM' => "Telimele",
'TOG' => "Tougue",
'YOM' => "Yomou");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gn() {
return array(
'minlng' => -15.1616,
'minlat' => 7.179467,
'maxlng' => -7.68565,
'maxlat' => 12.672033,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Guadeloupe
function location_province_list_gp() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gp() {
return array(
'minlng' => -61.81885,
'minlat' => 15.840433,
'maxlng' => -61.1777,
'maxlat' => 16.4324,
);
}

View File

@@ -0,0 +1,25 @@
<?php
// Equatorial Guinea
function location_province_list_gq() {
return array('AN' => "Provincia Annobon",
'BN' => "Provincia Bioko Norte",
'BS' => "Provincia Bioko Sur",
'CS' => "Provincia Centro Sur",
'KN' => "Provincia Kie-Ntem",
'LI' => "Provincia Litoral",
'WN' => "Provincia Wele-Nzas");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gq() {
return array(
'minlng' => 8.34785,
'minlat' => 0.824267,
'maxlng' => 11.456,
'maxlat' => 3.7184,
);
}

View File

@@ -0,0 +1,31 @@
<?php
// Greece
function location_province_list_gr() {
return array('AT' => "Attica",
'CN' => "Central Greece",
'CM' => "Central Macedonia",
'CR' => "Crete",
'EM' => "East Macedonia and Thrace",
'EP' => "Epirus",
'II' => "Ionian Islands",
'NA' => "North Aegean",
'PP' => "Peloponnesos",
'SA' => "South Aegean",
'TH' => "Thessaly",
'WG' => "West Greece",
'WM' => "West Macedonia");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gr() {
return array(
'minlng' => 19.65595,
'minlat' => 34.851,
'maxlng' => 28.16225,
'maxlat' => 41.885033,
);
}

View File

@@ -0,0 +1,21 @@
<?php
// South Georgia and the South Sandwich Islands
function location_province_list_gs() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gs() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => -42.118768,
'minlat' => -59.472802,
'maxlng' => -26.238677,
'maxlat' => -53.456787,
);
}

View File

@@ -0,0 +1,40 @@
<?php
// Guatemala
function location_province_list_gt() {
return array('AV' => "Alta Verapaz",
'BV' => "Baja Verapaz",
'CM' => "Chimaltenango",
'CQ' => "Chiquimula",
'PE' => "El Peten",
'PR' => "El Progreso",
'QC' => "El Quiche",
'ES' => "Escuintla",
'GU' => "Guatemala",
'HU' => "Huehuetenango",
'IZ' => "Izabal",
'JA' => "Jalapa",
'JU' => "Jutiapa",
'QZ' => "Quetzaltenango",
'RE' => "Retalhuleu",
'ST' => "Sacatepequez",
'SM' => "San Marcos",
'SR' => "Santa Rosa",
'SO' => "Solola",
'SU' => "Suchitepequez",
'TO' => "Totonicapan",
'ZA' => "Zacapa");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gt() {
return array(
'minlng' => -92.28845,
'minlat' => 13.7392,
'maxlng' => -88.23725,
'maxlat' => 17.783133,
);
}

View File

@@ -0,0 +1,19 @@
<?php
// Guam
function location_province_list_gu() {
return array();
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gu() {
return array(
'minlng' => 144.62375,
'minlat' => 13.277267,
'maxlng' => 144.98795,
'maxlat' => 13.6521,
);
}

View File

@@ -0,0 +1,27 @@
<?php
// Guinea-Bissau
function location_province_list_gw() {
return array('BF' => "Bafata Region",
'BB' => "Biombo Region",
'BS' => "Bissau Region",
'BL' => "Bolama Region",
'CA' => "Cacheu Region",
'GA' => "Gabu Region",
'OI' => "Oio Region",
'QU' => "Quinara Region",
'TO' => "Tombali Region");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gw() {
return array(
'minlng' => -16.92935,
'minlat' => 10.839167,
'maxlng' => -13.6464,
'maxlat' => 12.672033,
);
}

View File

@@ -0,0 +1,28 @@
<?php
// Guyana
function location_province_list_gy() {
return array('BW' => "Barima-Waini",
'CM' => "Cuyuni-Mazaruni",
'DM' => "Demerara-Mahaica",
'EC' => "East Berbice-Corentyne",
'EW' => "Essequibo Islands-West Demerara",
'MB' => "Mahaica-Berbice",
'PM' => "Pomeroon-Supenaam",
'PI' => "Potaro-Siparuni",
'UD' => "Upper Demerara-Berbice",
'UT' => "Upper Takutu-Upper Essequibo");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_gy() {
return array(
'minlng' => -61.3364,
'minlat' => 1.278567,
'maxlng' => -56.5865,
'maxlat' => 8.373633,
);
}

View File

@@ -0,0 +1,40 @@
<?php
// Hong Kong
function location_province_list_hk() {
return array(
'HCW' => "Central and Western Hong Kong Island",
'HEA' => "Eastern Hong Kong Island",
'HSO' => "Southern Hong Kong Island",
'HWC' => "Wan Chai Hong Kong Island",
'KKC' => "Kowloon City Kowloon",
'KKT' => "Kwun Tong Kowloon",
'KSS' => "Sham Shui Po Kowloon",
'KWT' => "Wong Tai Sin Kowloon",
'KYT' => "Yau Tsim Mong Kowloon",
'NIS' => "Islands New Territories",
'NKT' => "Kwai Tsing New Territories",
'NNO' => "North New Territories",
'NSK' => "Sai Kung New Territories",
'NST' => "Sha Tin New Territories",
'NTP' => "Tai Po New Territories",
'NTW' => "Tsuen Wan New Territories",
'NTM' => "Tuen Mun New Territories",
'NYL' => "Yuen Long New Territories",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_hk() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => 113.837319,
'minlat' => 22.1786990,
'maxlng' => 114.401316,
'maxlat' => 22.5605361,
);
}

View File

@@ -0,0 +1,26 @@
<?php
// Heard Island and McDonald Islands
function location_province_list_hm() {
return array(
'F' => "Flat Island",
'M' => "McDonald Island",
'S' => "Shag Island",
'H' => "Heard Island",
);
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_hm() {
// NaturalEarth 10m Admin 0 - Countries (v1.3.0)
// EPSG:900913
return array(
'minlng' => 73.2363871,
'minlat' => -53.192669,
'maxlng' => 73.8452388,
'maxlat' => -52.961572,
);
}

View File

@@ -0,0 +1,36 @@
<?php
// Honduras
function location_province_list_hn() {
return array('AT' => "Atlantida",
'CH' => "Choluteca",
'CL' => "Colon",
'CM' => "Comayagua",
'CP' => "Copan",
'CR' => "Cortes",
'PA' => "El Paraiso",
'FM' => "Francisco Morazan",
'GD' => "Gracias a Dios",
'IN' => "Intibuca",
'IB' => "Islas de la Bahia (Bay Islands)",
'PZ' => "La Paz",
'LE' => "Lempira",
'OC' => "Ocotepeque",
'OL' => "Olancho",
'SB' => "Santa Barbara",
'VA' => "Valle",
'YO' => "Yoro");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_hn() {
return array(
'minlng' => -89.3019,
'minlat' => 12.961867,
'maxlng' => -82.8413,
'maxlat' => 17.467133,
);
}

View File

@@ -0,0 +1,39 @@
<?php
// Croatia
function location_province_list_hr() {
return array('01' => "Zagreb county",
'02' => "Krapina-Zagorje county",
'03' => "Sisak-Moslavina county",
'04' => "Karlovac county",
'05' => "Varazdin county",
'06' => "Koprivnica-Krizevci county",
'07' => "Bjelovar-Bilogora county",
'08' => "Primorje-Gorski Kotar county",
'09' => "Lika-Senj county",
'10' => "Virovitica-Podravina county",
'11' => "Pozega-Slavonia county",
'12' => "Brod-Posavina county",
'13' => "Zadar county",
'14' => "Osijek-Baranja county",
'15' => "Sibenik-Knin county",
'16' => "Vukovar-Srijem county",
'17' => "Split-Dalmatia county",
'18' => "Istria county",
'19' => "Dubrovnik-Neretva county",
'20' => "Medjimurje county",
'21' => "Zagreb (city)");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_hr() {
return array(
'minlng' => 13.50481,
'minlat' => 42.4555,
'maxlng' => 19.2728,
'maxlat' => 46.583016,
);
}

View File

@@ -0,0 +1,27 @@
<?php
// Haiti
function location_province_list_ht() {
return array('AR' => "Artibonite",
'CE' => "Centre",
'GA' => "Grand'Anse",
'ND' => "Nord",
'NE' => "Nord-Est",
'NO' => "Nord-Ouest",
'OU' => "Ouest",
'SD' => "Sud",
'SE' => "Sud-Est");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_ht() {
return array(
'minlng' => -74.49565,
'minlat' => 18.0219,
'maxlng' => -71.62015,
'maxlat' => 20.107033,
);
}

View File

@@ -0,0 +1,57 @@
<?php
// Hungary
function location_province_list_hu() {
return array('BU' => "Budapest",
'BC' => "Bekescsaba",
'DB' => "Debrecen",
'DJ' => "Dunaujvaros",
'EG' => "Eger",
'GY' => "Gyor",
'HM' => "Hodmezovasarhely",
'KP' => "Kaposvar",
'KC' => "Kecskemet",
'MK' => "Miskolc",
'NK' => "Nagykanizsa",
'NY' => "Nyiregyhaza",
'PC' => "Pecs",
'SO' => "Sopron",
'SG' => "Szeged",
'SK' => "Szekesfehervar",
'SL' => "Szolnok",
'SB' => "Szombathely",
'TB' => "Tatabanya",
'ZG' => "Zalaegerszeg",
'BK' => "Bacs-Kiskun",
'BR' => "Baranya",
'BS' => "Bekes",
'BA' => "Borsod-Abauj-Zemplen",
'CG' => "Csongrad",
'FJ' => "Fejer",
'GM' => "Gyor-Moson-Sopron",
'HB' => "Hajdu-Bihar",
'HV' => "Heves",
'JN' => "Jasz-Nagykun-Szolnok",
'KE' => "Komarom-Esztergom",
'NG' => "Nograd",
'PE' => "Pest",
'SM' => "Somogy",
'SS' => "Szabolcs-Szatmar-Bereg",
'TO' => "Tolna",
'VA' => "Vas",
'VZ' => "Veszprem",
'ZA' => "Zala");
}
/**
* Returns minimum and maximum latitude and longitude needed to create a bounding box.
*/
function location_bounds_hu() {
return array(
'minlng' => 16.065,
'minlat' => 45.768167,
'maxlng' => 22.88665,
'maxlat' => 48.577,
);
}

Some files were not shown because too many files have changed in this diff Show More