yunusga/carbon-field-map-yandex
Composer 安装命令:
composer require yunusga/carbon-field-map-yandex
包简介
Carbon Fields extension, that adds a Map Yandex field type.
README 文档
README
The map field provides a Yandex-powered map with an address search field for Carbon Fields.
Field::make( 'map_yandex', 'crb_map', __( 'Yandex Map' ) )
Install via Composer
composer require yunusga/carbon-field-map-yandex
Information
The field stores several pieces of related information:
| Atribute | Description | Value Type | Value |
|---|---|---|---|
'value' |
Latitude & Longitude | (string) |
11.370946,142.591472 |
'lat' |
Latitude | (float) |
11.370946 |
'lng' |
Longitude | (float) |
142.591472 |
'address' |
Address | (string) |
The lowest point of the Mariana Trench |
'zoom' |
Zoom level | (int) |
4 |
Yandex Maps JS Key setup
As of October 11, 2018, Yandex requires users to generate an API key in order to use the Yandex Maps API: https://yandex.ru/blog/mapsapi/novye-pravila-dostupa-k-api-kart?from=club
You can get your API key here: https://developer.tech.yandex.ru/services/3/
Once you're ready with the process of generating a key, you'll need to provide the key to Carbon Fields through a filter:
/** * Provide the Yandex Maps API key to Carbon Fields * * @param string $key Yandex JS API key. */ function crb_get_yandex_maps_api_key( $key ) { return 'your key goes here'; } add_filter( 'carbon_fields_map_yandex_field_api_key', 'crb_get_yandex_maps_api_key' );
Config methods
set_position( $lat, $lng, $zoom )
Set the default position on the map specified by $lat and $lng and the default zoom level to $zoom (zoom 0 corresponds to a map of the Earth fully zoomed out).
Field::make( 'map_yandex', 'crb_company_location', __( 'Location' ) ) ->set_help_text( __( 'drag and drop the pin on the map to select location' ) )
Usage
To get all the location data as an array, you can use the map_yandex type in the retrieval functions. Example:
// Get the location data. $map_yandex = carbon_get_post_meta( $post_id, $field_name );
Value Format
array( 'value' => '11.370946,142.591472', 'lat' => 11.370946, 'lng' => 142.591472, 'zoom' => 4, 'address' => 'The lowest point of the Mariana Trench', )
yunusga/carbon-field-map-yandex 适用场景与选型建议
yunusga/carbon-field-map-yandex 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 22 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 06 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「carbon-field」 「carbon-field-map-yandex」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 yunusga/carbon-field-map-yandex 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yunusga/carbon-field-map-yandex 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 yunusga/carbon-field-map-yandex 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Carbon Fields extension, that adds a Icon field type.
Carbon Fields extension, that adds a SmartLink field type.
Carbon Fields extension, that adds a Rich Text field type with no media.
A basic Carbon Fields extension, that adds support for Number type field.
Carbon Fields extension, that adds a URL picker field type.
Carbon Fields extension, that adds a Radio_Image_Enhanced field type.
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2022-06-25