当前位置: 首页>>代码示例>>PHP>>正文


PHP Map::addLocation方法代码示例

本文整理汇总了PHP中Map::addLocation方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::addLocation方法的具体用法?PHP Map::addLocation怎么用?PHP Map::addLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Map的用法示例。


在下文中一共展示了Map::addLocation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Map

<!DOCTYPE html>
<html>
	<head>
		<title>Map Tests</title>
	</head>
	<body>
		<h1>Map Tests</h1>
		<?php 
include_once "../includer.php";
$map = new Map(null);
echo "Map ID: " . $map->getMapID();
echo "<hr/>";
echo "<h3>Should add three locations to map and print</h3>";
$map->addLocation("New York");
$map->addLocation("London");
$map->addLocation("Rome");
foreach ($map->getLocations() as $location) {
    echo "<h4>{$location}</h4>";
}
echo "<hr/>";
echo "<h3>Should remove last location and print remaining</h3>";
$map->removeLastLocation();
foreach ($map->getLocations() as $location) {
    echo "<h4>{$location}</h4>";
}
echo "<hr/>";
?>
	</body>
</html>
开发者ID:mikeschap,项目名称:WithTheClothesOnYourBack,代码行数:29,代码来源:Map_tests.php

示例2: Map

<!DOCTYPE html>
<html>
	<head>
		<title>MapView Tests</title>
	</head>
	<body>
		<h1>MapView Tests</h1>
		<h3>Should call MapView::show()</h3>
		<hr/>
		<?php 
include_once "../includer.php";
$map = new Map(null);
$map->addLocation("Rome");
MapView::show($map->getLocations());
?>
	</body>
</html>
开发者ID:mikeschap,项目名称:WithTheClothesOnYourBack,代码行数:17,代码来源:MapView_tests.php

示例3: connectDB

<?php

header('Access-Control-Allow-Origin: http://localhost:63342/alertt_app/map.html');
class Map
{
    public function connectDB($sql)
    {
        $conn = new mysqli("localhost", "root", "root", "alertt_db");
        $conn->query($sql);
        $conn->close();
    }
    public function addLocation()
    {
        $hazard = filter_input(INPUT_POST, 'hazard');
        $comment = filter_input(INPUT_POST, 'comment');
        $lat = filter_input(INPUT_POST, 'lat');
        $lng = filter_input(INPUT_POST, 'lng');
        $SQL = 'INSERT INTO hazards_tb (hazard, comment,lat,lng) VALUES ("' . $hazard . '","' . $comment . '","' . $lat . '","' . $lng . '")';
        $this->connectDB($SQL);
    }
}
$map = new Map();
echo $map->addLocation();
开发者ID:beshad,项目名称:alertt_server,代码行数:23,代码来源:map.php


注:本文中的Map::addLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。