Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f76589a

Browse files
committed
Reintroduce OpenStreetMapsProvider for BC purpose
Closes #269
1 parent f09d3df commit f76589a

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ A valid api key is required.
154154

155155
### OpenStreetMapProvider ###
156156

157-
The `OpenStreetMapProvider` named `openstreetmap` is able to geocode and reverse geocode **street addresses**.
157+
The `OpenStreetMapProvider` named `openstreetmap` is able to geocode and reverse
158+
geocode **street addresses**.
159+
160+
**Warning:** The `OpenStreetMapsProvider` is **deprecated**, and you should
161+
rather use the `OpenStreetMapProvider`. See issue
162+
[#269](https://github.com/geocoder-php/Geocoder/issues/269).
158163

159164
### NominatimProvider ###
160165

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the Geocoder package.
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*
8+
* @license MIT License
9+
*/
10+
11+
namespace Geocoder\Provider;
12+
13+
use Geocoder\HttpAdapter\HttpAdapterInterface;
14+
15+
/**
16+
* @author William Durand <[email protected]>
17+
*/
18+
class OpenStreetMapsProvider extends OpenStreetMapsProvider
19+
{
20+
/**
21+
* @param HttpAdapterInterface $adapter An HTTP adapter.
22+
* @param string $locale A locale (optional).
23+
*/
24+
public function __construct(HttpAdapterInterface $adapter, $locale = null)
25+
{
26+
parent::__construct($adapter, static::ROOT_URL, $locale);
27+
28+
trigger_error('The `OpenStreetMapsProvider` is deprecated and will be removed. Use the `OpenStreetMapProvider` instead.', E_USER_DEPRECATED);
29+
}
30+
31+
/**
32+
* {@inheritDoc}
33+
*/
34+
public function getName()
35+
{
36+
return 'openstreetmaps';
37+
}
38+
}

0 commit comments

Comments
 (0)