Newer
Older
www-root / coverage / police4.js
  1. var debug = {};
  2.  
  3. var map = L.map('map').setView([36.131, 140.241], 9); // Kasumigaura
  4.  
  5. //OSMレイヤー追加
  6. var osm = L.tileLayer(
  7. 'http://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {
  8. attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a>',
  9. maxZoom: 18
  10. }
  11. );
  12. osm.addTo(map);
  13.  
  14. var mvtSource0 = new L.TileLayer.MVTSource({
  15. url: "./tiles/tilePolice4z/{z}/{x}/{y}.pbf",
  16. style: function (feature) {
  17. var style = {};
  18. style.color = 'rgba(255,0,0,1)';
  19. style.radius = 5;
  20. style.selected = {
  21. radius: 6
  22. };
  23. return style;
  24. }
  25. });
  26. map.addLayer(mvtSource0);
  27.  
  28. var mvtSource1 = new L.TileLayer.MVTSource({
  29. url: "./tiles/tilePolice4/{z}/{x}/{y}.pbf",
  30. style: function (feature) {
  31. var style = {};
  32. style.color = 'rgba(0,255,0,1)';
  33. style.radius = 5;
  34. style.selected = {
  35. radius: 6
  36. };
  37. return style;
  38. }
  39. });
  40. map.addLayer(mvtSource1);
  41.  
  42. //Globals that we can change later.
  43. var fillColor = 'rgba(149,139,255,0.4)';
  44. var strokeColor = 'rgb(20,20,20)';
  45.  
  46. //Add layer
  47. mvtSource1.addTo(map);
  48. mvtSource0.addTo(map);
  49.  
  50. L.control.scale({imperial:false}).addTo(map);