frolki1_dev/google-embed-php
Composer 安装命令:
composer require frolki1_dev/google-embed-php
包简介
Use the Embed API of Google Maps with PHP
README 文档
README
Use the Embed API of Google Maps with PHP
Requirement
To use this library you must have at least PHP 7.0.
Installation
The Google Embed can be installed with Composer. Run this command:
composer require frolki1_dev/google-embed-php
Usage
To use this library you must have an api key. You can get the free version because you can use the embed api for free.
use Frolki1_Dev\GoogleEmbedMap; $maps = new GoogleEmbedMap(<Add here your api key>); // Create a direction map $direction = $maps->createDirectionsMap(); // Create a place map $place = $maps->createPlaceMap(); // Crsate a search map $search = $maps->createSearchMap(); // Create a view map $view = $maps->createViewMap();
Options
You have the following options in every map type:
// Set a location (street, location, place) $mapType->setLocation(<string>); // Set the center of the view (latitude and longitude) $mapType->setCenter(<float>, <float>); // Set the zoom factor (0 - 21, 0 = Whole world, 21 = A single building) $mapType->setZoom(<int>); // Define the UI language $mapType->setLanguage(<string>); // Show the map as a road map $mapType->useRoadMap(); // Show the map as a satellite map $mapType->useSatelliteMap(); // Get the source (url) $mapType->getSource(); // Build a iframe $mapType->getIFrame();
Direction options
The direction map has also the options and the following methods:
// How the method setLocation but only the start point $direction->start(<string>); // Same how method start but only the destination point $direction->destination(<string>); // Add waypoints (Can be multiple called) $direction->addWayPoint(<string>); // Calculate the route with the car $direction->drivingMode(); // Calculate the route with walking $direction->walkingMode(); // Calculate the route with biking $direction->bicyclingMode(); // Calclate the route with flying $direction->flyingMode(); // Avoid tolls $direction->avoidTolls(); // Avoid Ferry $direction->avoidFerries(); // Avoid Highway $dircetion->avoidHighways(); // Use the metric unit $direction->useMetricUnit(); // Use the imperial unit $direction->useImperialUnit();
License
This library is an open source project and is licensed under the MIT license.
frolki1_dev/google-embed-php 适用场景与选型建议
frolki1_dev/google-embed-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 30 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 04 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 frolki1_dev/google-embed-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 frolki1_dev/google-embed-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-29