ズームレベルによるマーカーの表示切替

&googlemaps3(lat=35.7643434, lng=136.933593, mapname=zoommk, width=400px, height=300px, zoomctrl=small, typectrl=normal, zoom=6);
&googlemaps3_icon(default, define=sensen, shadow=, iw=30, ih=100, sw=0, sh=0, ianchorx=15, ianchory=50, transparent=);
&googlemaps3_icon(本陣,     class=sensen, image=http://reddog.s35.xrea.com/img/googlemaps/mztCenter.gif, ih=50, ianchory=25);
&googlemaps3_icon(東部戦線, class=sensen, image=http://reddog.s35.xrea.com/img/googlemaps/mztEast.gif);
&googlemaps3_icon(西部戦線, class=sensen, image=http://reddog.s35.xrea.com/img/googlemaps/mztWest.gif);
&googlemaps3_icon(南部戦線, class=sensen, image=http://reddog.s35.xrea.com/img/googlemaps/mztSouth.gif);
&googlemaps3_icon(北部戦線, class=sensen, image=http://reddog.s35.xrea.com/img/googlemaps/mztNorth.gif);

&googlemaps3_mark(0, 0, define=zoommkwide, map=zoommk, formatlist=%title%, minzoom=0, maxzoom=7, noinfowindow=1, nolist=1);
&googlemaps3_mark(0, 0, define=zoommkdetail, map=zoommk, formatlist=%title%, minzoom=8, maxzoom=17, nolist=1);
&googlemaps3_mark(35.063725, 135.705871, class=zoommkwide, title=本陣, icon=本陣);
&googlemaps3_mark(35.010328, 135.768285, class=zoommkdetail, title=織田信長);
&googlemaps3_mark(35.036912, 135.753969, class=zoommkdetail, title=織田信忠);
&googlemaps3_mark(35.013373, 135.581932, class=zoommkdetail, title=明智光秀);
&googlemaps3_mark(34.685169, 135.488891, class=zoommkwide, title=南部戦線, icon=南部戦線);
&googlemaps3_mark(34.687781, 135.52597, class=zoommkdetail, title=丹羽長秀);
&googlemaps3_mark(34.582026, 135.468957, class=zoommkdetail, title=徳川家康);
&googlemaps3_mark(34.605625, 136.532507, class=zoommkdetail, title=織田信雄);
&googlemaps3_mark(35.603718, 135.123596, class=zoommkwide, title=北部戦線, icon=北部戦線);
&googlemaps3_mark(35.565764, 135.147661, class=zoommkdetail, title=細川忠興);
&googlemaps3_mark(36.659606, 138.317871, class=zoommkwide, title=東部戦線, icon=東部戦線);
&googlemaps3_mark(36.813631, 137.397122, class=zoommkdetail, title=柴田勝家);
&googlemaps3_mark(36.392667, 139.061208, class=zoommkdetail, title=滝川一益);
&googlemaps3_mark(36.565771, 138.196442, class=zoommkdetail, title=森長可);
&googlemaps3_mark(34.714524, 133.879394,34, class=zoommkwide, title=西部戦線, icon=西部戦線);
&googlemaps3_mark(34.693832, 133.82206, class=zoommkdetail, title=羽柴秀吉);

ズームの広域(0~7)と、ズームの詳細(8~)で表示するマーカーを切り替えています。
マーカーの数が多くなったらこういう風にして、表示するマーカーを間引いていくと速度が稼げる。


PukiwikiでGoogleMaps3サンプル CategoryJavaScript CategoryPukiwiki


|New|Edit|Freeze|Diff|Backup|Attach|Copy|Rename|
Last-modified: 2012-10-27 (Sat) 17:29:23 (2606d)
HTML convert time: 0.039 sec.