定制 booosta/openstreetmap_org 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

booosta/openstreetmap_org

Composer 安装命令:

composer require booosta/openstreetmap_org

包简介

Show openstreetmap maps in the Booosta Framework

README 文档

README

This modules provides the possibility to show maps from openstreetmap.org in a Booosta web application. It can also be used standalone without the Booosta framework.

Booosta allows to develop PHP web applications quick. It is mainly designed for small web applications. It does not provide a strict MVC distinction. Although the MVC concepts influence the framework. Templates, data objects can be seen as the Vs and Ms of MVC.

Up to version 3 Booosta was available at Sourceforge: https://sourceforge.net/projects/booosta/ From version 4 on it resides on Github and is available from Packagist under booosta/booosta .

Installation

This module can be used inside the Booosta framework. If you want to do so, install the framework first. See the installation instructions for accomplishing this. If your Booosta is installed, you can install this module.

You also can use this module in your standalone PHP scripts. In both cases you install it with:

composer require booosta/openstreetmap_org

Usage in the Booosta framework

In your scripts you use the module:

# [...]
$map = $this->makeInstance('openstreetmap_org', $lat, $lon, $zoom);
$html = $map->get_html();

Usage in standalone PHP scripts

In your PHP script you use:

<?php
require_once __DIR__ . '/vendor/autoload.php';

use \booosta\openstreetmap_org\Openstreetmap_org as OSM;

$map = new OSM($lat, $lon, $zoom);
print $map->loadHTML();

$lat and $lon are the latitude and longitude of the center of the map. They are in degree. For example 16.847477. $zoom is the zoom factor of the map. Default is 15. You also can set the with and height of the map (before calling get_html() or loadHTML()):

$map->width($width);
$map->height($height);

Markers

You can place markers on your map. You just have to provide the coordinates of all markers:

$markers = [ [$lat1, $lon1], [$lat2, $lon2] ];
$map->set_markers($markers);
$map->add_marker($lat3, $lon3);

This will display 3 markers with these coordinates.

You can display the HTML as usual in your Booosta templates:

# myscript.php
$this->TPL['mymap'] = $map->get_html();

# mytemplate.tpl
{%mymap}

booosta/openstreetmap_org 适用场景与选型建议

booosta/openstreetmap_org 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 booosta/openstreetmap_org 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 booosta/openstreetmap_org 我们能提供哪些服务?
定制开发 / 二次开发

基于 booosta/openstreetmap_org 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2022-03-02