Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.get("/map_geojson.cgi", function(data) {
- var geojsonLayer = new L.GeoJSON(data, {
- style: function(feature) {
- if (feature.geometry.type == 'LineString') {
- geojsonPolyLineOptions.color = feature.properties.color;
- return geojsonPolyLineOptions;
- } else {
- return {fillColor: feature.properties.color};
- }
- },
- pointToLayer: function(feature, latlng) {
- geojsonMarkerOptions.fillColor=feature.properties.color;
- return L.circleMarker(latlng, geojsonMarkerOptions);
- },
- onEachFeature: function(feature, layer) {
- createPopup(feature, layer);
- map.on('almost:click', createPopup(feature, layer));
- }
- } );
- map.addLayer(geojsonLayer);
- map.almostOver.addLayer(geojsonLayer);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement