diff --git a/index.js b/index.js index 850a6ff..a60ffe1 100644 --- a/index.js +++ b/index.js @@ -44,6 +44,15 @@ $.getJSON("index.json") ).done(function(data) { site = data.site; + style = new ol.style.Style({ + image: new ol.style.Icon({ + src: site + 'lib/img/osm_200x200.png', + anchor: [0.5, 0.5], + scale: 0.2 + }), + stroke: new ol.style.Stroke({color: '#ff33ff', width: 10}) + }); + $(data.list).each(function() { var feature = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.fromLonLat(this.coordinates)), diff --git a/index.json b/index.json index 14f43ee..1dcca44 100644 --- a/index.json +++ b/index.json @@ -1,5 +1,5 @@ { - "site": "./", + "site": "http://surveyor.mydns.jp/osm-data/", "list": [ {"code": "01100", "name": "北海道 札幌市", "path": "01100_sapporo-shi_2020", "coordinates":[141.35477,43.06172]}, {"code": "11230", "name": "福島県 郡山市", "path": "07203_koriyama-shi_2020", "coordinates":[140.33421,37.40464]}, diff --git a/index2.js b/index2.js index d7fa900..438ec65 100644 --- a/index2.js +++ b/index2.js @@ -38,6 +38,15 @@ $.getJSON("index.json") ).done(function(data1) { site = data1.site; + style = new ol.style.Style({ + image: new ol.style.Icon({ + src: site + 'lib/img/osm_200x200.png', + anchor: [0.5, 0.5], + scale: 0.2 + }), + stroke: new ol.style.Stroke({color: '#ff33ff', width: 10}) + }); + $(data1.list).each(function() { if (this.code == code) { lonlat = this.coordinates;