i-prikot/moonshine-yandexmap 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

i-prikot/moonshine-yandexmap

最新稳定版本:v1.0.0

Composer 安装命令:

composer require i-prikot/moonshine-yandexmap

包简介

YandexMap for MoonShine

README 文档

README

A custom Yandex Maps field for MoonShine admin panel that allows users to interact with Yandex Maps, place markers, and save coordinates.

Features

  • Interactive Yandex Maps integration
  • Placemark management (add/delete)
  • Configurable default map center and zoom level

Installation

  1. Install the package via Composer:

    composer require iprikot/moonshine-yandexmap
  2. Publish the configuration file:

    php artisan vendor:publish --tag=moonshine-yandexmap-config
  3. Add your Yandex Maps API key to the .env file:

    MOONSHINE_YANDEXMAP_API_KEY=your_api_key_here

Usage

Basic Usage

use Iprikot\YandexMap\Fields\YandexMap;

// In your MoonShine resource
YandexMap::make('Location', 'location')

Customization Options

YandexMap::make('Location', 'location')
    ->width('100%') // or 500, '50vw', etc.
    ->height(400) // or '50vh', '30rem', etc.
    ->defaultMapCenter(56.023097, 92.874172) // latitude, longitude
    ->defaultMapZoom(13)
    ->defaultIconHEXColor('#0095b6')
    ->selectedIconHEXColor('#ff0000')
    ->deletePlacemarkButtonLabel('Remove marker')
    ->fitToBoundsButtonLabel('Fit to bounds');

Configuration

The package comes with a config file (moonshine_yandexmap.php) where you can set default values:

return [
    'api_key' => env('MOONSHINE_YANDEXMAP_API_KEY', ''),
];

Data Structure

The field stores data as JSON with the following structure:

{
    "center": [56.023097, 92.874172],
    "zoom": 13,
    "placemarks": [[56.023097, 92.874172],[58.023097, 92.874172]]
}

Requirements

  • PHP 8.0+
  • MoonShine 3.0+
  • Yandex Maps API 2.1

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固