C#做googleMap添加层,如何与后台交互?急,顶者有分。。。
js:
<script type="text/javascript">
var geocoder;
var map;
var iIndex=0;
$(function(){
geocoder=new google.maps.Geocoder();
initialize();
});
function initialize()
{
var latlng = new google.maps.LatLng(31.14, 121.27);
var myOptions = {zoom: 10,center: latlng,mapTypeId: google.maps.MapTypeId.ROADMAP};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
//google.maps.event.addListener(map);
//google.maps.event.addListener(map,'click',function(event){drawInMap(event.latLng,iIndex++)});
}
</script>
html:
<div id="map_canvas" style="width: 1115px; height: 687px; float:left; border: 1px solid black;"></div>
我想在地图加载成功时,在地图上放几个层div(div的个数,div中的文字,div中的图片都是从后台(数据库)读取的) ,
就是这个要求,因为地图是用js加载的,我如何获取后台的数据放到层(地图上的)中。。。?