mfeldheim / map-stuff
与地图相关的工具
1.1
2014-01-24 16:15 UTC
Requires
- php: >=5.3.2
- guzzle/http: >=3.7.0,<3.9.0
- guzzle/plugin-oauth: >=3.7.0,<3.9.0
- phpunit/phpunit: 3.7.28
Requires (Dev)
- ext-gd: *
This package is not auto-updated.
Last update: 2024-09-24 00:46:31 UTC
README
与地图相关的工具
类 \Geo\Coder
客户端用于从网络服务接收坐标。已实现插件
- Y!Boss (Yahoo)
- Nominatim (OSM)
使用方法
use Geo\Coder\Plugin;
$geocoder = new \Geo\Coder(
new Nominatim( array(
'requestURI' => 'http://nominatim.openstreetmap.org/search',
'i118n' => 'en'
))
);
$result = self::$geocoder->fetchCoords(
'Muellerstr. 40, 80469 München',
Coder::PRECISION_HIGH
);
$result->getLat();
$result->getLon();
// etc.
类 \Geo\Projection
将经纬度转换为地图上的像素
使用方法
$mapProjection = new \Geo\Projection();
$pixelCoordinates = $mapProjection->degreesToPixels( $latitude, $longitude, $mapWidth, $mapHeight );
示例文件 examples/drawPointsOnMap.php
# composer install
php drawPointsOnMap.php
要求
- php >= 5.3.2
- php-gd(可选,带 freetype 支持)