ExcelVBAとGoogleMapの連携について。
作成したExcelVBAの保管や備忘録的なもの。
|
Calendar |
Recent Entry |
Recent Comment |
Category |
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
緯度、経度情報からGoogleMap上に複数のマーカーを立てた後、「これじゃデータの中身がわからない・・・」
そんなときに見つけたのがGoogleChartAPIのDynamic Icons。URLを投げるとアイコンを作成してくれます。
あとはGooglemapのマーカーのコンストラクタ内でMarkerImageのURLにDynamic IconsのURLを指定します。
以下、コード↓↓
var GChartApi ='http://chart.apis.google.com/chart?chst=d_bubble_text_small&chld=bbtl|';
var map = new google.maps.Map(document.getElementById('map-canvas'),mapOps);
var iconAnchor = new google.maps.Point(0,0);
var Markers = [
[35.6197000,139.7285530,'%E5%A4%A7%E5%B4%8E%E9%A7%85|FF0000|FFFFFF'],
[35.6264460,139.7234440,'%E4%BA%94%E5%8F%8D%E7%94%B0%E9%A7%85|FF0000|FFFFFF'],
[35.6339980,139.7158280,'%E7%9B%AE%E9%BB%92%E9%A7%85|FF0000|FFFFFF'],
[35.6466900,139.7101060,'%E6%81%B5%E6%AF%94%E5%AF%BF%E9%A7%85|FFC000|000000'],
[35.6585170,139.7013340,'%E6%B8%8B%E8%B0%B7%E9%A7%85|FFC000|000000'],
[35.6701680,139.7026870,'%E5%8E%9F%E5%AE%BF%E9%A7%85|FFC000|000000'],
[35.6830610,139.7020420,'%E4%BB%A3%E3%80%85%E6%9C%A8%E9%A7%85|FFC000|000000'],
[35.6909210,139.7002580,'%E6%96%B0%E5%AE%BF%E9%A7%85|FFFF00|000000'],
[35.7013060,139.7000440,'%E6%96%B0%E5%A4%A7%E4%B9%85%E4%BF%9D%E9%A7%85|FFFF00|000000'],
[35.7122850,139.7037820,'%E9%AB%98%E7%94%B0%E9%A6%AC%E5%A0%B4%E9%A7%85|FFFF00|000000'],
[35.7212040,139.7065870,'%E7%9B%AE%E7%99%BD%E9%A7%85|92D050|000000'],
[35.7289260,139.7103800,'%E6%B1%A0%E8%A2%8B%E9%A7%85|92D050|000000'],
[35.7314010,139.7286620,'%E5%A4%A7%E5%A1%9A%E9%A7%85|92D050|000000'],
[35.7334920,139.7393450,'%E5%B7%A3%E9%B4%A8%E9%A7%85|92D050|000000'],
[35.7364890,139.7468750,'%E9%A7%92%E8%BE%BC%E9%A7%85|92D050|000000'],
[35.7380620,139.7608600,'%E7%94%B0%E7%AB%AF%E9%A7%85|00B050|000000'],
[35.7321350,139.7667870,'%E8%A5%BF%E6%97%A5%E6%9A%AE%E9%87%8C%E9%A7%85|00B0F0|000000'],
[35.7277720,139.7709870,'%E6%97%A5%E6%9A%AE%E9%87%8C%E9%A7%85|00B0F0|000000'],
[35.7204950,139.7788370,'%E9%B6%AF%E8%B0%B7%E9%A7%85|0070C0|FFFFFF'],
[35.7137680,139.7772540,'%E4%B8%8A%E9%87%8E%E9%A7%85|0070C0|FFFFFF'],
[35.7074380,139.7746320,'%E5%BE%A1%E5%BE%92%E7%94%BA%E9%A7%85|0070C0|FFFFFF'],
[35.6986830,139.7742190,'%E7%A7%8B%E8%91%89%E5%8E%9F%E9%A7%85|002060|FFFFFF'],
[35.6916900,139.7708830,'%E7%A5%9E%E7%94%B0%E9%A7%85|002060|FFFFFF'],
[35.6813820,139.7660840,'%E6%9D%B1%E4%BA%AC%E9%A7%85|002060|FFFFFF'],
[35.6750690,139.7633280,'%E6%9C%89%E6%A5%BD%E7%94%BA%E9%A7%85|002060|FFFFFF'],
[35.6654980,139.7596400,'%E6%96%B0%E6%A9%8B%E9%A7%85|FFFFFF|FF0000'],
[35.6556460,139.7567490,'%E6%B5%9C%E6%9D%BE%E7%94%BA%E9%A7%85|FFFFFF|FF0000'],
[35.6457360,139.7475750,'%E7%94%B0%E7%94%BA%E9%A7%85|FFFFFF|FF0000'],
[35.6301520,139.7404400,'%E5%93%81%E5%B7%9D%E9%A7%85|FFFFFF|FF0000']
];
var mapOps = {
zoom:17,
center:new google.maps.LatLng(35.6197000,139.7285530),
panControl:false,
mapTypeId:google.maps.MapTypeId.LOADMAP
};
for (var i = Markers.length;i--;){
new google.maps.Marker({
map:map,
position:new google.maps.LatLng(Markers[i][0], Markers[i][1]),
icon:new google.maps.MarkerImage(GChartApi+Markers[i][2],null,null,iconAnchor)
});
};
↑↑ここまで
var map = new google.maps.Map(document.getElementById('map-canvas'),mapOps);
var iconAnchor = new google.maps.Point(0,0);
var Markers = [
[35.6197000,139.7285530,'%E5%A4%A7%E5%B4%8E%E9%A7%85|FF0000|FFFFFF'],
[35.6264460,139.7234440,'%E4%BA%94%E5%8F%8D%E7%94%B0%E9%A7%85|FF0000|FFFFFF'],
[35.6339980,139.7158280,'%E7%9B%AE%E9%BB%92%E9%A7%85|FF0000|FFFFFF'],
[35.6466900,139.7101060,'%E6%81%B5%E6%AF%94%E5%AF%BF%E9%A7%85|FFC000|000000'],
[35.6585170,139.7013340,'%E6%B8%8B%E8%B0%B7%E9%A7%85|FFC000|000000'],
[35.6701680,139.7026870,'%E5%8E%9F%E5%AE%BF%E9%A7%85|FFC000|000000'],
[35.6830610,139.7020420,'%E4%BB%A3%E3%80%85%E6%9C%A8%E9%A7%85|FFC000|000000'],
[35.6909210,139.7002580,'%E6%96%B0%E5%AE%BF%E9%A7%85|FFFF00|000000'],
[35.7013060,139.7000440,'%E6%96%B0%E5%A4%A7%E4%B9%85%E4%BF%9D%E9%A7%85|FFFF00|000000'],
[35.7122850,139.7037820,'%E9%AB%98%E7%94%B0%E9%A6%AC%E5%A0%B4%E9%A7%85|FFFF00|000000'],
[35.7212040,139.7065870,'%E7%9B%AE%E7%99%BD%E9%A7%85|92D050|000000'],
[35.7289260,139.7103800,'%E6%B1%A0%E8%A2%8B%E9%A7%85|92D050|000000'],
[35.7314010,139.7286620,'%E5%A4%A7%E5%A1%9A%E9%A7%85|92D050|000000'],
[35.7334920,139.7393450,'%E5%B7%A3%E9%B4%A8%E9%A7%85|92D050|000000'],
[35.7364890,139.7468750,'%E9%A7%92%E8%BE%BC%E9%A7%85|92D050|000000'],
[35.7380620,139.7608600,'%E7%94%B0%E7%AB%AF%E9%A7%85|00B050|000000'],
[35.7321350,139.7667870,'%E8%A5%BF%E6%97%A5%E6%9A%AE%E9%87%8C%E9%A7%85|00B0F0|000000'],
[35.7277720,139.7709870,'%E6%97%A5%E6%9A%AE%E9%87%8C%E9%A7%85|00B0F0|000000'],
[35.7204950,139.7788370,'%E9%B6%AF%E8%B0%B7%E9%A7%85|0070C0|FFFFFF'],
[35.7137680,139.7772540,'%E4%B8%8A%E9%87%8E%E9%A7%85|0070C0|FFFFFF'],
[35.7074380,139.7746320,'%E5%BE%A1%E5%BE%92%E7%94%BA%E9%A7%85|0070C0|FFFFFF'],
[35.6986830,139.7742190,'%E7%A7%8B%E8%91%89%E5%8E%9F%E9%A7%85|002060|FFFFFF'],
[35.6916900,139.7708830,'%E7%A5%9E%E7%94%B0%E9%A7%85|002060|FFFFFF'],
[35.6813820,139.7660840,'%E6%9D%B1%E4%BA%AC%E9%A7%85|002060|FFFFFF'],
[35.6750690,139.7633280,'%E6%9C%89%E6%A5%BD%E7%94%BA%E9%A7%85|002060|FFFFFF'],
[35.6654980,139.7596400,'%E6%96%B0%E6%A9%8B%E9%A7%85|FFFFFF|FF0000'],
[35.6556460,139.7567490,'%E6%B5%9C%E6%9D%BE%E7%94%BA%E9%A7%85|FFFFFF|FF0000'],
[35.6457360,139.7475750,'%E7%94%B0%E7%94%BA%E9%A7%85|FFFFFF|FF0000'],
[35.6301520,139.7404400,'%E5%93%81%E5%B7%9D%E9%A7%85|FFFFFF|FF0000']
];
var mapOps = {
zoom:17,
center:new google.maps.LatLng(35.6197000,139.7285530),
panControl:false,
mapTypeId:google.maps.MapTypeId.LOADMAP
};
for (var i = Markers.length;i--;){
new google.maps.Marker({
map:map,
position:new google.maps.LatLng(Markers[i][0], Markers[i][1]),
icon:new google.maps.MarkerImage(GChartApi+Markers[i][2],null,null,iconAnchor)
});
};
↑↑ここまで
PR
コメント
|
プロフィール
|
HN:
akira kumagai
性別:
非公開
最新記事
|
P R
|