我使用Mapbox,AngularJS和Ionic框架;这是我的控制器:
//using omnivore to add marker in csv file
var restroom_marker_layer = omnivore.csv('/lib/airports3.csv', null, L.mapbox.featureLayer().on('ready',function(e){
var clusterGroup = new L.MarkerClusterGroup();
e.target.eachLayer(function(layer) {
var cluster_marker = clusterGroup.addLayer(layer);
restroom_marker.push(layer._latlng);
layer.bindPopup('<button class="button button-icon ion-ios-star-outline rate"></button><button class="button button-icon ion-ios-star-outline rate"></button><button class="button button-icon ion-ios-star-outline rate"></button><button class="button button-icon ion-ios-star-outline rate"></button><button class="button button-icon ion-ios-star-outline rate"></button><br/><button class="button button-outline button-positive departure_point" value="' + layer._latlng.lng + ',' + layer._latlng.lat + '">출발</button><br/><button class="button button-outline button-assertive destination_point" value="' + layer._latlng.lng + ',' + layer._latlng.lat + '">도착</button><br/><button class="button button-outline button-royal evaluation" value="' + layer._latlng.lng + ',' + layer._latlng.lat + '">평가</button>',{closeButton: false});
});
map.addLayer(clusterGroup);
}));
这在网络浏览器中运行良好,但在iOS中无法正常工作且未添加标记。
错误信息
restroom_prj[22202:1332450] error JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures.
如何解决这些问题?