我在我的應用程序中關注了this link。反過來,我得到我的設備中的空白,並且不顯示.Map
。用json加載標記
代碼:
<script type="text/javascript">
$(function() {
$('#map_canvas').gmap().bind('init', function() {
$.getJSON('http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxx?latitude=&longitude=', function(data) {
$.each(data.Status.Shoplist, function(i, m) {
$('#map_canvas').gmap('addMarker', { 'position': new google.maps.LatLng(m.lat, m.lng)});
});
});
});
});
</script>
JSON:
{"Status" :{ "Shoplist":[ { "id" : "1", "Name" : "ee", "phone" : "", "fax" : "", "latitude" : "xxxxxx", "longitude" : "yyyyyyy" } , { "id" : "3", "Name" : "hhh", "phone" : "", "fax" : "", "latitude" : "xxxx", "longitude" : "yyyyy" } ,..... } ]}}