alfredog1976/maptive-rest-api

v1.1 2018-06-19 17:33 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:42:02 UTC


README

安装

通过 Composer

composer require alfredog1976/maptive-rest-api

简介

Maptive 允许您使用电子表格数据创建自定义谷歌地图。该 API 将允许您将数据写入自定义字段,这些字段可以转换为特定的地图数据。更多信息请访问 https://www.maptive.com/

入门

  1. 创建 Maptive 账户。您需要一个付费账户来获取 API 密钥。
  2. 发送电子邮件至 support@maptive.com 以获取您的 API 密钥。
  3. 创建地图。地图 ID 将是 URL 中的 "map_id" 参数。
https://fortress.maptive.com/ver4/new_ui/index.php?&map_id=xxxxxx

设置

认证

    $maptive = new \alfredog1976\Maptive\Maptive('MAPTIVE API KEY', 'MAP ID');

添加

	// Array index must match your Maptive map column index
    $my_column_array = array("Field 1 Data", "Field 2 Data", "Field 3 Data");
    
    $maptive->add($my_column_array);

添加(特定列)

    
    // Maptive columns data in associative array can be in any order 
    $my_column_array = array("2"=>"Field 3 Data", "1"=>"Field 2 Data");
    
    $maptive->addSpecificCols($my_column_array);

更新

    // Update 1 column using your Maptive index    
    $maptive->update("My Maptive Index", "column_1", "Field 1 Data");
    

更新(特定列)

    // Update multiple columns using your Maptive index. Columns can be in any order 
    $my_column_array = array("2"=>"Field 3 Data", "1"=>"Field 2 Data");
    
    $maptive->addSpecificCols("My Maptive Index", $my_column_array);
    

删除

    $maptive->delete("My Maptive Index");

修补

    $maptive->patch();

Alfred Garcia alfredog1976 alfredog1976@yahoo.com