function myInit() {

var gsi = L.tileLayer('//cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://maps.gsi.go.jp">国土地理院地図</a> contributors'
});

var osm = L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
 attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
});

var Bing = new L.BingLayer("AvRR1iCvcIBp2R9fSTjK7FSHYDT0zpGCWT9PoyO7gHt9nEFBOcROZuuTnXjhWOig",
{type: "Road", culture: "ja"});

var BingAir = new L.BingLayer("AvRR1iCvcIBp2R9fSTjK7FSHYDT0zpGCWT9PoyO7gHt9nEFBOcROZuuTnXjhWOig",
{type: "Aerial", culture: "ja"});

var WithLabels = new L.BingLayer("AvRR1iCvcIBp2R9fSTjK7FSHYDT0zpGCWT9PoyO7gHt9nEFBOcROZuuTnXjhWOig",
{type: "AerialWithLabels", culture: "ja"});

var LabelsOnDe = new L.BingLayer("AvRR1iCvcIBp2R9fSTjK7FSHYDT0zpGCWT9PoyO7gHt9nEFBOcROZuuTnXjhWOig",
{type: "AerialWithLabelsOnDemand", culture: "ja"});

var map = L.map('aegis', { zoomControl: false });
gsi.addTo(map);
map.setView([38.8675, 139.8190], 11);

var baseMaps = {
    "地理院地図" : gsi,
    "オープンストリートマップ"  : osm,
    "BingMap" : Bing,
    "BingMap衛星写真"　: BingAir,
    "BingMap地名あり"　: WithLabels,
    "BingMap地名＋"　: LabelsOnDe
  };

  //layersコントロールにbaseMapsオブジェクトを設定して地図に追加
  //コントロール内にプロパティ名が表示される

L.control.layers(baseMaps).addTo(map);
L.control.scale(baseMaps).addTo(map);
L.control.zoom({ position: 'topleft' }).addTo(map);

var qIcon = L.icon({
  iconUrl: 'https://www.yatex.org/gitbucket/utaka0416/AegisforEcosystem/raw/b50fb1b1ee781b5ae09b6fbebfb3543014aa4fd4/leaflet-old/material/daigakulogo.png',
  iconSize:     [30, 30],
});

var toriIcon = L.icon({
  iconUrl: 'https://www.yatex.org/gitbucket/utaka0416/AegisforEcosystem/raw/b50fb1b1ee781b5ae09b6fbebfb3543014aa4fd4/leaflet-old/material/hyoutyou.png',
  iconSize:     [25, 25],
});

L.marker([38.8935,139.810],{title:"公益大",icon:qIcon}).addTo(map);

L.geoJSON(preserveofmogami, 
  {
      style: premogamistyle,
    onEachFeature: function onEachFeature(
      feature,
      layer
    ){
      if(feature.properties && feature.properties.popupContent){
        layer.bindPopup(feature.properties.popupContent);
      }
    }
  }
).addTo(map);

var gj= L.geoJson(bird, {
  pointToLayer: function (feature, latlng) {
    return L.marker(latlng, {icon: toriIcon});
  },
  style: function (feature) {
    return feature.properties ;
},
onEachFeature: function(feature, layer) {
  let p =feature.properties;
  if (p) {
    let name = p.name, desc = p.description, sea = p.season;
    let popup = 
      "<p>" + name + "</p>" +
      "<p>" + desc.replace(/{{(.*)}}/, '<img src="' + RegExp.$1 + '">'); + "</p>" +
      "<p>" + sea + "</p>";
    layer.bindPopup(popup);
  }
}
}).addTo(map);

/*var gj= omnivore.geoJson(birdermapinsakata.geojson, null, 
  L.geojson(null, {onEachFeature: setProperty}));
  gj.addTo(jsonmap);*/

map.fitBounds(gj.getBounds());
}
document.addEventListener("DOMContentLoaded", myInit, false);

      /*"<p>" + feature.properties.name + "</p>" +
      "<p>" + feature.properties.season + "</p>" +
      "<p>" + feature.properties.description(description.replace(/{{(.*)}}, '<img src="' + Regexp.$1 + '">'); + "</p>" +
      "<p><img src=" + feature.properties.image + " /></p>"
        )
    }
}).addTo(map);

onEachFeature: function(j, layer) {
    let p = j.properties;
    if (p) {
      let name = p.name, desc = p.description, add = p.address, gra = p.photographer, sea = p.season;
      let popup = "<p>" + name + "</p>" + "<p>" + desc + "</p>" + "<p>" + add + "</p>" + "<p>" + gra + "</p>" + "<p>" + sea + "</p>";
      layer.bindPopup(popup);
    }
  }
}).addTo(map);

 /*{{}}*/

//L.geoJSON(wildbirdplace).addTo(map);*/
