in2code/osm 问题修复 & 功能扩展

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

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

in2code/osm

Composer 安装命令:

composer require in2code/osm

包简介

OSM - OpenStreetMap extension for TYPO3

README 文档

README

Introduction

A small but modern OpenStreetMap extension for TYPO3 (11 and newer). You can simply show a map with or without markers. One or more addresses can be added as human-readable address or with geo coordinates.

A second plugin allows you to show addresses from tt_address records (when tt_address.latitude and .longitude is filled).

No jQuery, just vanilla JS. Modern asset collector used for includes of JS or CSS. PSR-14 eventdispatcher can be used to manipulate markers and labels.

Plugin 1

screenshot_pi1_frontend.png

screenshot_pi1_backend.png

Plugin 2

screenshot_pi1_frontend.png

screenshot_pi2_backend.png

Note Ensure that fields tt_address.name, tt_address.description, tt_address.latitude and tt_address.longitude is filled correctly

Installation

Add this extension via composer (TYPO3 in classic mode could work but is not supported):

composer require in2code/osm

Don't forget to add typeNum 1597149189 for AJAX requests for the markers to your siteconfiguration like:

...
routeEnhancers:
  PageTypeSuffix:
    type: PageType
    default: /
    suffix: /
    index: ''
    map:
      /: 0
      .html: 0
      'feed.xml': 9818
      'markers.json': 1597149189
...

FAQ

How to overwrite paths?

As always via TypoScript setup - like

plugin.tx_osm {
    view {
        templateRootPaths {
            0 = EXT:osm/Resources/Private/Templates/
            1 = EXT:yoursitepackage/Resources/Private/Templates/Extensions/Osm/
        }
        layoutRootPaths {
            0 = EXT:osm/Resources/Private/Layouts/
            1 = EXT:yoursitepackage/Resources/Private/Layouts/Extensions/Osm/
        }
    }
}

How to define own css or js?

CSS and JS is included via Layout html template. You can simply adjust the paths to your needs.

Filter address in Pi2 to some pages

If you don't want to present all available tt_address records in your FlexForm selection for your editors, you can filter it via Page TSconfig to one or more pages like:

tx_osm {
  flexform {
    pi2 {
      addressPageIdentifiers = 2,3,4
    }
  }
}

Manipulate markers

You can manipulate markers via PSR-14 Eventdispatcher as described.

Configuration/Services.yaml in your sitepackage:

services:
  Vendor\YourSitepackage\EventListener\OsmManipulator:
    tags:
      - name: event.listener
        identifier: 'osm-marker-manipulation'
        event: In2code\Osm\Domain\Model\MarkerContainer

Example dispatcher:

<?php
declare(strict_types=1);
namespace Vendor\YourSitepackage\EventListener;

use In2code\Osm\Domain\Model\Marker;
use In2code\Osm\Domain\Model\MarkerContainer;

/**
 * Class OsmManipulator as an example
 */
class OsmManipulator
{
    /**
     * @param MarkerContainer $markerContainer
     * @return void
     */
    public function __invoke(MarkerContainer $markerContainer): void
    {
        /** @var Marker $marker */
        foreach ($markerContainer->getMarkers() as $marker) {
            $marker->setMarker(1);
            $marker->setTitle('new title');
            $marker->setDescription('new description');
            $marker->setLatitude(10.00000);
            $marker->setLongitude(10.00000);
            $marker->setIcon('/typo3conf/ext/yoursitepackage/Resources/Public/Icons/Marker.png');
            $marker->setIconHeight(28);
            $marker->setIconWidth(28);
            $marker->setIconOffsetX(1);
            $marker->setIconOffsetY(-10);
        }
    }
}

Contribution with ddev

This repository provides a DDEV-backed development environment. If DDEV is installed, simply run the following commands to quickly set up a local environment with example usages:

  • ddev start
  • ddev initialize

Requirements

  1. Install ddev, see: https://ddev.readthedocs.io/en/stable/#installation
  2. Install git-lfs, see: https://git-lfs.github.com/

Installation

  1. Clone this repository
  2. Run ddev start
  3. Run ddev initialize to setup configurations and test database

Branchinfo

  • Main Branch - Next Major Version
  • typo3-v13: Version V13 for TYPO3 13
  • typo3-v12: Version V4 for TYPO3 12

Early Access Programm for TYPO3 14 support

ℹ️ TYPO3 14 compatibility

See EAP page (DE) or EAP page (EN) for more information how to get access to a TYPO3 14 version

Changelog

Version Date State Description
13.0.0 2025-08-08 Task Support TYPO3 13
4.0.3 2024-08-23 Bugfix Fix possible missing array key exception in Pi1
4.0.2 2024-04-12 Bugfix Fix problem with tt_address TCA if there is no tt_address installed
4.0.1 2024-02-05 Bugfix Small bugfix for TYPO3 TER upload
4.0.0 2023-12-28 Task Support TYPO3 12
3.1.0 2023-01-11 Task Prevent unneeded warning in log
3.0.0 2022-05-30 Task Update for TYPO3 10 and 11
2.1.1 2022-01-24 Bugfix Prevent no_cache warnings in TYPO3 log file; set correct repo url in composer.json
2.1.0 2021-03-17 Task Add autorelease to TER function, add extension key to composer.json
2.0.2 2020-09-30 Bugfix Fix wrong translated german labels in backend for latitude/longitude.
2.0.1 2020-09-21 Task Small label change.
2.0.0 (!!!) 2020-09-18 Feature Allow more then only one address in Pi1 now. Allow to extend extension with PSR-14 eventdispatcher.
1.2.0 2020-08-13 Bugfix Prevent let in JavaScript to support old browsers. Adjust marker size.
1.1.0 2020-08-13 Task Some small improvements (marker image with outline, some adjustments of the views in backend)
1.0.0 2020-08-12 Task Initial release

in2code/osm 适用场景与选型建议

in2code/osm 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.79k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2020 年 08 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「osm」 「typo3」 「OpenStreetMap」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2020-08-12