Larave-admin 微信海外地图 (HereMap) 扩展包

这个扩展包是基于 laravel-admin-extensions/latlong 扩展的,解决腾讯地图在海外无法显示对应地点。微信海外版使用的诺基亚的here地图,可以保证显示效果和国外一致,方便企业发展海外业务。

转载于我自己的博客,原文地址 Larave-admin 微信海外地图(HereMap)扩展包

使用效果

Larave-admin 微信海外地图(HereMap)扩展包

源码地址

使用方法

composer require pippiqiang/latlong

README

Latitude and longitude selector

这个扩展用来帮助你在form表单中选择经纬度,用来替代Laravel-admin中内置的Form\Field\Map组件, 组件支持的地图包括Google map百度地图高德地图腾讯地图Yadex map.

This extension is used to help you select the latitude and longitude in the form, which is used to replace the Laravel-admin built in Form\Field\Map component. The supported maps include Google map, Baidu map, AMap, Tencent Map, Yadex map.

Installation

composer require laravel-admin-ext/latlong -vvv

Configuration

Open config/admin.php and add the following configuration to the extensions section:


    'extensions' => [

        'latlong' => [

            // Whether to enable this extension, defaults to true
            'enable' => true,

            // Specify the default provider
            'default' => 'google',

            // According to the selected provider above, fill in the corresponding api_key
            'providers' => [

                'google' => [
                    'api_key' => '',
                ],

                'yadex' => [
                    'api_key' => '',
                ],

                'baidu' => [
                    'api_key' => 'xck5**************************dx',
                ],

                'tencent' => [
                    'api_key' => 'VV***-*****-*****-*****-*****-**BBT',
                ],

                'amap' => [
                    'api_key' => '3693**************************fb',
                ],

                'here' => [
                    'app_key' => 'ge*************************************WeD0'
                ],
            ]
        ]
    ]

Usage

Suppose you have two fields latitude and longitude in your table that represent latitude and longitude, then use the following in the form:

$form->latlong('latitude', 'longitude', 'Position');

// Set the map height
$form->latlong('latitude', 'longitude', 'Position')->height(500);

// Set the map zoom
$form->latlong('latitude', 'longitude', 'Position')->zoom(16);

// Set default position
$form->latlong('latitude', 'longitude', 'Position')->default(['lat' => 90, 'lng' => 90]);

Use in show page

$show->field('Position')->latlong('lat_column', 'long_column', $height = 400, $zoom = 16);

License

Licensed under The MIT License (MIT).

本作品采用《CC 协议》,转载必须注明作者和本文链接
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!