location.be.inc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. // Belgium
  3. function location_province_list_be() {
  4. return array(
  5. 'VAN' => "Antwerpen",
  6. 'VBR' => "Vlaams Brabant",
  7. 'VLI' => "Limburg",
  8. 'VOV' => "Oost-Vlaanderen",
  9. 'VWV' => "West-Vlaanderen",
  10. 'WBR' => "Brabant Wallon",
  11. 'WHT' => "Hainaut",
  12. 'WLG' => "Liege",
  13. 'WLX' => "Luxembourg",
  14. 'WNA' => "Namur",
  15. // While technically not a province, Brussels-Capital Region is needed here
  16. // because some places would be completely without a province if we did not
  17. // include it.
  18. // See http://drupal.org/node/228766 and http://drupal.org/node/291590.
  19. 'BRU' => "Brussels",
  20. );
  21. }
  22. /**
  23. * Returns minimum and maximum latitude and longitude needed to create a bounding box.
  24. */
  25. function location_bounds_be() {
  26. return array(
  27. 'minlng' => 2.5104,
  28. 'minlat' => 49.518533,
  29. 'maxlng' => 6.3713,
  30. 'maxlat' => 51.528667,
  31. );
  32. }
  33. function location_map_link_be_providers() {
  34. return array(
  35. 'google' => array(
  36. 'name' => 'Google Maps',
  37. 'url' => 'http://maps.google.be/',
  38. 'tos' => 'http://maps.google.be/help/terms_maps.html',
  39. ),
  40. );
  41. }
  42. function location_map_link_be_default_providers() {
  43. return array('google');
  44. }
  45. function location_map_link_be_google($location = array()) {
  46. $query_params = array();
  47. foreach (array('street', 'city', 'postal_code', 'country') as $field) {
  48. if (isset($location[$field])) {
  49. $query_params[] = $location[$field];
  50. }
  51. }
  52. if (count($query_params)) {
  53. return ('http://maps.google.co.be?q='. urlencode(implode(', ', $query_params)));
  54. }
  55. else {
  56. return NULL;
  57. }
  58. }