我将ruby升级到1.9.3,现在我无法启动服务器.当我运行bundle install时,它说
An error occurred while installing libv8 (3.11.8.17), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.11.8.17'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)
当我试图安装那个宝石时,它说
ERROR: Error installing libv8:
ERROR: Failed to build gem native extension.
/Users/Erica/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: g++
Unable to find a compiler officially supported by v8.
It is recommended …Run Code Online (Sandbox Code Playgroud) 我试图建立在mapbox集群地图,像http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html
但他们的示例使用普通的.js文件作为数据 http://www.mapbox.com/mapbox.js/assets/realworld.388.js
我可以从mapbox唯一得到的是.geojson http://api.tiles.mapbox.com/v3/thebteam.map-w9jzcznw/markers.geojson
有没有办法可以将geojson转换为js(定期)?或者从mapbox导出javascript数组?
编辑:最终将我的数据切换为CSV并找到解析器.这是有效的代码,如果有人需要它:
var url = 'https://docs.google.com/spreadsheet/pub?key=abc123';
$.get(url, function(data) {
var addressPoints = $.csv.toArrays(data);
var map = L.mapbox.map('map', 'map-abc123').setView([20.30, 18.98], 2);
var markers = new L.MarkerClusterGroup({ showCoverageOnHover: false });
for (var i = 0; i < addressPoints.length; i++) {
var a = addressPoints[i];
var title = a[2];
var marker = L.marker(new L.LatLng(a[0], a[1]), {
icon: L.mapbox.marker.icon({'marker-size': 'small', 'marker-color': 'e8168c'}),
title: title
});
marker.bindPopup(title);
markers.addLayer(marker);
}
map.addLayer(markers);
});
Run Code Online (Sandbox Code Playgroud)