wwwision/neos-addresseditor 问题修复 & 功能扩展

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

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

wwwision/neos-addresseditor

Composer 安装命令:

composer require wwwision/neos-addresseditor

包简介

Simple Neos extension adding a custom property editor for addresses, including GeoCoding

README 文档

README

Simple Neos extension adding a custom property editor for postal addresses and GeoCoding support

Features

This package comes with two main features:

  1. A custom property editor for PostalAddress-properties
  2. A GeoCoding service that can look up GeoCoordinates by Postal- and IP Addresses (based on the great willdurand/geocoder package)

Usage

Install the package using composer:

composer require wwision/neos-addresseditor:^1.0

After successful installation you should configure a Google Maps API key:

Wwwision:
  Neos:
    AddressEditor:
      googleMapsApiKey: '<VALID_GOOGLE_MAPS_API_KEY>'

(For testing purposes you should be able to skip that step)

To make use of the new Property Editor, just add a property of PostalAddress to any NodeType configuration:

'Some.Package:SomeNodeType':
  # ...
  properties:
    'someProperty':
      type: 'Wwwision\Neos\AddressEditor\PostalAddress'

Afterwards you should be able to see the new PostalAddressEditor in the Neos Backend:

Screenshot expanded editor Screenshot collapsed editor

Note: The green checkmark indicates that the geocoding for this address has been successful

Display coordinates

When the geocoding was successful you can access the coordinates via the longitude and latitude fields of the address property. With a little bit of Fusion code you can make these available within a template (i.e. for rendering them in a Map):

prototype(Some.Package:SomeNodeType) < prototype(Neos.Fusion:Template) {
    templatePath = 'resource://Some.Package/Private/Templates/FusionObjects/Map.html'

    address = ${q(node).property('address')}
}

In the Fluid template you can then access the coordinates like this:

<f:if condition="{address}">
    <span class="marker" data-latitude="{address.latitude}" data-longitude="{address.longitude}">{address}</span>
</f:if>

License

Licensed under MIT, see LICENSE

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固