定制 flowaxy/geomap 二次开发

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

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

flowaxy/geomap

最新稳定版本:v1.0.0

Composer 安装命令:

composer require flowaxy/geomap

包简介

An SVG map generator from GeoJSON for Flowaxy projects.

README 文档

README

GeoMapSvgGenerator is a PHP class for generating interactive SVG maps from GeoJSON data.
It supports region tooltips, customizable dimensions, and custom markers (icons, counts, etc).

Features

  • Convert GeoJSON to interactive SVG maps
  • Render regions with optional tooltips
  • Add markers with icons, labels, or counts
  • Control output size and language for region names

Installation

Use Composer to install the library:

composer require flowaxy/geomap

Usage

use Flowaxy\GeoMapSvgGenerator;

$geojson = 'ukraine.geojson';
$markers = [
    ['lat' => 50.45, 'lng' => 30.52, 'type' => 'capital', 'icon' => '', 'name' => 'Kyiv'],
];

$generator = new GeoMapSvgGenerator($geojson, $markers, 1000, 800, true, 'uk');
$svg = $generator->generateSvg();

file_put_contents('map.svg', $svg);

Marker Format

Each marker may contain:

  • lat (float): Latitude
  • lng (float): Longitude
  • type (string): Marker type (used as CSS class)
  • icon (string): Emoji or symbol instead of circle
  • count (int): Number shown below
  • label (string): Text label
  • name (string): Tooltip text

Getting GeoJSON files

You can download GeoJSON files for countries, regions, or the entire world from:

For Ukraine specifically, you can try:

Make sure your file contains valid GeoJSON structure with features and geometry.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

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