Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. var points = L.geoJson(dtr_points, {
  2. onEachFeature: function (feature, layer) {
  3. var link_url = "<a href='" + feature.properties.Link + "' target='_blank'>" + feature.properties.Name + "</a>"
  4. console.log(link_url);
  5. layer.bindPopup(link_url);
  6.  
  7. if(feature.properties.Type == "beer") {
  8. layer.setIcon(beer);
  9. };
  10. if(feature.properties.Type == "bar") {
  11. layer.setIcon(bar);
  12. };
  13. if(feature.properties.Type == "restaurant") {
  14. layer.setIcon(restaurant);
  15. };
  16. if(feature.properties.Type == "music") {
  17. layer.setIcon(music);
  18. };
  19. if(feature.properties.Type == "culture") {
  20. layer.setIcon(culture);
  21. };
  22. if(feature.properties.Type == "cafe") {
  23. layer.setIcon(cafe);
  24. };
  25. if(feature.properties.Type == "occult shop") {
  26. layer.setIcon(occult);
  27. };
  28. }
  29. }).addTo(map);
  30.  
  31. L.control.zoom({
  32. position:'bottomright'
  33. }).addTo(map);
  34.  
  35. L.control.layers(points).addTo(map);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement