承接 cowegis/cowegis-contao-geocode-widget-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

cowegis/cowegis-contao-geocode-widget-bundle

Composer 安装命令:

composer require cowegis/cowegis-contao-geocode-widget-bundle

包简介

Cowegis - Content Web GIS Geocode Widget For Contao

README 文档

README

Build Status Version License Downloads

This extension provides a widget to pick coordinates from a map. It uses the leaflet framework.

Requirements

  • Contao ^4.13||^5.0
  • PHP ^8.2

Install

1. Install using composer

php composer.phar require cowegis/cowegis-contao-geocode-widget-bundle

2. Use the widget

Coordinates only

The widget is used to add a map icon which opens a map in a pop-up. You can enter an address in the search field and press Enter to resolve it. Either a list of suggested addresses is displayed or a marker is placed on the map. The marker can still be positioned using the mouse. Click on the ‘Apply’ button to apply the geocoordinates.

$GLOBALS['TL_DCA']['tl_example']['fields']['coordinates'] = [
    'label'     => ['Coordinates', 'Enter the coordinates - comma separated as \'latitude,longitude\'.'],
    'inputType' => 'cowegis_geocode',
    'eval'      => [
        'tl_class' => 'w50',
    ],
    'sql' => 'varchar(255) NOT NULL default \'\''
];

However, if you already have input fields for the address, such as postcode, town and street, you don't want to have to enter this information again in the search field in the pop-up.

With the appropriate information in the DCA, you can automatically transfer this information to the search field – here is an example for fields street, zip and city and country fixed as "Deutschland":

$GLOBALS['TL_DCA']['tl_example']['fields']['coordinates'] = [
    'label'     => ['Coordinates', 'Enter the coordinates - comma separated as \'latitude,longitude\'.'],
    'inputType' => 'cowegis_geocode',
    'eval'      => [
        'query_pattern'    => '#ctrl_street# #ctrl_zip# #ctrl_city#, Deutschland',
        'url_template'     => 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
        'attribution'      => 'Tiles style by <a href="https://www.hotosm.org/" target="_blank">Humanitarian OpenStreetMap Team</a> hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>'.
        'tl_class'         => 'w50',
    ],
    'sql' => 'varchar(255) NOT NULL default \'\''
];

The information is as follows:

  • query_pattern: Pattern as it appears in the search input in the pop-up - the field IDs with #<id>#
  • url_template: Template for the map
  • attribution: Note on the map layer

Coordinates and radius

To pick the radius in meters as well, you have to configure the eval.radius option for the related radius field. The radius field should be a simple text input. The default, minval and maxval flags are passed to the geocode widget so that only radius in that boundary can be chosen.

$GLOBALS['TL_DCA']['tl_page']['fields']['coordinates'] = [
    'label'     => ['Coordinates', 'Enter the coordinates - comma separated as \'latitude,longitude\'.'],
    'inputType' => 'cowegis_geocode',
    'eval'      => [
        'tl_class' => 'w50',
        'radius'   => 'radius'
    ],
    'sql' => 'varchar(255) NOT NULL default \'\''
];

$GLOBALS['TL_DCA']['tl_page']['fields']['radius'] = [
    'label'     => ['Radius', 'Specification of the radius in metres.'],
    'inputType' => 'cowegis_radius', // Optional, you can use a text widget as well
    'eval'      => [
        'default'  => 500,
        'minval'   => 100,
        'maxval'   => 5000,
        'steps'    => 100, // Round value to the closest 100 m.
        'tl_class' => 'w50',
    ],
    'sql' => 'varchar(255) NOT NULL default \'\''
];

If you want to add a wizard icon to the radius field as well, you only have to reference the coordinate field.

$GLOBALS['TL_DCA']['tl_page']['fields']['radius'] = [
    'label'     => ['Radius', 'Specification of the radius in metres.'],
    'inputType' => 'cowegis_radius',
    'eval'      => [
        'rgxp'        => 'natural',
        'default'     => 500,
        'minval'      => 100,
        'maxval'      => 5000,
        'tl_class'    => 'w50 wizard',
        'coordinates' => 'coordinates'
    ],
    'sql' => 'varchar(255) NOT NULL default \'\''
];

cowegis/cowegis-contao-geocode-widget-bundle 适用场景与选型建议

cowegis/cowegis-contao-geocode-widget-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.15k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 09 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 cowegis/cowegis-contao-geocode-widget-bundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2024-09-12