Google地图和Bing地图是客户端(JavaScript支持的),这就是为什么您不会找到任何PHP库的原因。
要在地图上显示感兴趣的地方,您需要从数据库中提取项目,然后使用JavaScript将它们添加到地图中。在谷歌地图,这看起来像这样:
// instantiate the map
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(54.673830, -4.746093),
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 8
});
// create an InfoWindow
var infowindow = new google.maps.InfoWindow();
// fetch results from a PHP script
// assumes results are returned as a JSON-encoded array
$.getJSON('script.php', function(results) {
$.each(results, function(i, result) {
// create a market representing place of interest
var marker = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(result.latitude, result.longitude);
title: result.title
});
// display information in infowindow on click
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(result.content);
infowindow.open(map, marker);
});
});
});
希望这会让你开始。查看Google Maps JavaScript API的文档,其中包含API的全面指南以及大量示例。
我建议不要使用任何插件。 Google Maps API很容易直接使用,它有很好的文档记录和良好的支持。晦涩的插件引入了比解决问题更多的问题,并且限制了获得支持的机会。不要被“容易”这个词引诱。 :-) – Marcelo