2014-09-20 24 views
-1

我不知道谷歌是否有这样或没有这样的功能。 我在我的分贝是DD(十进制度)。它存储在像这样的数据库36.308428 -95.316914谷歌地图十进制度或网页上的DD位置

我想要做的是从数据库拉这个信息,并在链接中的DD与链接,并在某种类型的弹出窗口中打开它并在DD上显示带有标记的地图。

这可能吗?

我发现这个,但我不喜欢它的是它嵌入在另一个人的网站。我宁愿只拥有地图,也不要在页面上做其他事情。

http://www.gps-coordinates.net/latitude-longitude/36.308428/-95.316914/10/roadmap

回答

1

试试这个php代码。

/* code to select the coordinates from your databases here*/ 
$row = $result->fetch_assoc(); 
$DD = $row['lat'].','.$row['long']; 
echo '<script>window.location = "https://www.google.gr/maps/place/'.$DD.'"</script>'; 
+0

谢谢你的信息,信息。我发现了一些不同的东西,更像是我想要的东西。但是你让我走上正轨! – Kelly 2014-09-21 02:07:29

0

这里是更多我在找。

while($row = mysqli_fetch_array($result)) { 
echo '<a href="http://maps.googleapis.com/maps/api/staticmap?center='; 
    echo $row['latitude'] . " ," . $row['longitude']; 
    echo '&zoom=18&size=1000x500&maptype=roadmap&markers=color:green%7Clabel:G%7C'; 
    echo $row['latitude'] . " ," . $row['longitude']; 
    echo '"> map </a> <br><br>'; 

}