Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. $.get("/map_geojson.cgi", function(data) {
  2. var geojsonLayer = new L.GeoJSON(data, {
  3. style: function(feature) {
  4. if (feature.geometry.type == 'LineString') {
  5. geojsonPolyLineOptions.color = feature.properties.color;
  6. return geojsonPolyLineOptions;
  7. } else {
  8. return {fillColor: feature.properties.color};
  9. }
  10. },
  11. pointToLayer: function(feature, latlng) {
  12. geojsonMarkerOptions.fillColor=feature.properties.color;
  13. return L.circleMarker(latlng, geojsonMarkerOptions);
  14. },
  15. onEachFeature: function(feature, layer) {
  16. createPopup(feature, layer);
  17. map.on('almost:click', createPopup(feature, layer));
  18. }
  19. } );
  20. map.addLayer(geojsonLayer);
  21. map.almostOver.addLayer(geojsonLayer);
  22.  
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement