Guest User

Untitled

a guest
Jul 29th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var L2 = new L.geoJson(L2, {
  2. style: function(feature) {
  3. return {
  4. color: 'black',
  5. weight: 7
  6. };
  7. },
  8. onEachFeature: function(feature, layer) {
  9. layer.on({
  10. 'mousemove': function(e) {
  11. e.target.setStyle({
  12. weight: 7,
  13. color: 'red'
  14. });
  15.  
  16. },
  17. 'mouseout': function(e) {
  18. L2.resetStyle(e.target);
  19. },
  20. 'click': function(e) {
  21. mymap.fitBounds(e.target.getBounds());
  22. L2.bindPopup("<b>" + feature.properties.Nom);
  23. }
  24. });
  25. }
  26. }).addTo(mymap);
Add Comment
Please, Sign In to add comment