在Google地图中叠加地理标记的照片?

时间:2009-02-21 16:17:42

标签: google-maps

我想创建一张Google地图,其中包含用户上传的地理标记照片,这些照片会显示在我的地图上。我可以轻松地创建操作我的地图,但我似乎找不到如何添加这些地理标记照片的说明。

以下是我尝试完成的示例: http://maps.google.com/?ie=UTF8&ll=26.892794,-80.055909&spn=0.003875,0.004828&t=h&z=18&lci=lmc:panoramio

3 个答案:

答案 0 :(得分:1)

我没有使用照片的经验,但我认为它不应该与你在照片的适当坐标上将GMarker放在地图上,然后在标签的信息窗口中会输出您的自定义HTML,其中包含您的照片。

修改:Google Maps API参考中指向GMarker类的特定链接:http://code.google.com/apis/maps/documentation/reference.html#GMarker

答案 1 :(得分:1)

您需要创建一个图块,然后创建一个图块叠加层。

var tilelayer = new GTileLayer(myCopyright);
tilelayer.getTileUrl = function() { return "../include/tile_crosshairs.png"; };
tilelayer.isPng = function() { return true;};
tilelayer.getOpacity = function() { return 1.0; }

var myTileLayer = new GTileLayerOverlay(tilelayer);
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
map.addOverlay(myTileLayer);

documentation is heregreat sample map here

答案 2 :(得分:1)

您可以使用PHP(或其他脚本)创建KML或GeoRSS文件(非常类似于Flickr的KML和GeoRSS供稿),并使用Google Maps API函数GGeoXML将文件作为叠加层加载到地图上。 请在此处查看Google的示例代码:http://code.google.com/apis/maps/documentation/examples/geoxml-rss.html

该示例实际上是从Flickr加载实时GeoRSS Feed。