1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage Openstreetmap
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die();
11
12 /**
13 * Openstreetmap API Info class for the Joomla Platform
14 *
15 * @since 13.1
16 * @deprecated 4.0 Use the `joomla/openstreetmap` package via Composer instead
17 */
18 class JOpenstreetmapInfo extends JOpenstreetmapObject
19 {
20 /**
21 * Method to get capabilities of the API
22 *
23 * @return array The XML response
24 *
25 * @since 13.1
26 */
27 public function getCapabilities()
28 {
29 // Set the API base
30 $base = 'capabilities';
31
32 // Build the request path.
33 $path = $this->getOption('api.url') . $base;
34
35 // Send the request.
36 $response = $this->oauth->oauthRequest($path, 'GET', array());
37
38 $xml_string = simplexml_load_string($response->body);
39
40 return $xml_string;
41 }
42
43 /**
44 * Method to retrieve map data of a bounding box
45 *
46 * @param float $left Left boundary
47 * @param float $bottom Bottom boundary
48 * @param float $right Right boundary
49 * @param float $top Top boundary
50 *
51 * @return array The XML response
52 *
53 * @since 13.1
54 */
55 public function retrieveMapData($left, $bottom, $right, $top)
56 {
57 // Set the API base
58 $base = 'map?bbox=' . $left . ',' . $bottom . ',' . $right . ',' . $top;
59
60 // Build the request path.
61 $path = $this->getOption('api.url') . $base;
62
63 // Send the request.
64 $response = $this->oauth->oauthRequest($path, 'GET', array());
65
66 $xml_string = simplexml_load_string($response->body);
67
68 return $xml_string;
69 }
70
71 /**
72 * Method to retrieve permissions for current user
73 *
74 * @return array The XML response
75 *
76 * @since 13.1
77 */
78 public function retrievePermissions()
79 {
80 // Set the API base
81 $base = 'permissions';
82
83 // Build the request path.
84 $path = $this->getOption('api.url') . $base;
85
86 // Send the request.
87 $response = $this->oauth->oauthRequest($path, 'GET', array());
88
89 $xml_string = simplexml_load_string($response->body);
90
91 return $xml_string;
92 }
93 }
94