firesphere/openstreetmaps
最新稳定版本:1.0.5
Composer 安装命令:
composer require firesphere/openstreetmaps
包简介
A frontend maps module.
README 文档
README
Usage:
MAPBOX_TOKEN=MyMapboxTokenSecret
Static image:
/** @var Location $location */ $location = Location::get()->last(); $service = new OpenStreetmapService(); $image = $service->getStaticMapImage($location, 500, 500, 15); echo $image->forTemplate(); exit;
The following will add a map to a div on your page with id map.
If the div doesn't exist, things will break ;)
Requirements::javascript('firesphere/openstreetmaps:dist/js/main.js'); Requirements::css('firesphere/openstreetmaps:dist/css/main.css'); $token = Environment::getEnv('MAPBOX_TOKEN'); Requirements::insertHeadTags( <<<JS <script type="text/javascript">var mapboxtoken = "$token";</script> JS ); $service = new OpenStreetmapService(); $locations = Location::get(); if ($locations->exists()) { $service->addLocations($locations->sort('Primary DESC')); }
Did you read this entire readme? You rock!
Pictured below is a cow, just for you.
/( ,,,,, )\
_\,;;;;;;;,/_
.-"; ;;;;;;;;; ;"-.
'.__/`_ / \ _`\__.'
| (')| |(') |
| .--' '--. |
|/ o o \|
| |
/ \ _..=.._ / \
/:. '._____.' \
;::' / \ .;
| _|_ _|_ ::|
.-| '==o==' '|-.
/ | . / \ | \
| | ::| | | .|
| ( ') (. )::|
|: | |; U U ;|:: | `|
|' | | \ U U / |' | |
##V| |_/`"""`\_| |V##
##V## ##V##
统计信息
- 总下载量: 307
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2023-09-15