ç¥ãåãã«ãªã
延æãããã ã¯ã€ãã¯ã¹ã¿ãŒã ãã»ã¯ã·ã§ã³ãéããææ¡ãããã³ãŒããã³ããŒããŸãã åäœããŸãïŒ ç¢ºãã«ãã¿ã€ãã«ã«ã¯krakozyabryã衚瀺ãããŠããŸãããæåã»ããã瀺ãã¿ã°ããªããããé©ãããšã§ã¯ãããŸããã ãŸããããŠã人çã®ããããªããšã ã³ãŒããèŠãŠãã ããã
// , : var myMap = new DG.Map('myMapId'); // : myMap.setCenter(new DG.GeoPoint(82.927810142519,55.028936234826)); // : myMap.setZoom(15);
ãµã æŒ ç¶ãš äœããç§ã«ãã®ããšãæãåºãããŸãã setCenterãããã«ãºãŒã ããããã«èšå®ã§ããªãçç±ã¯æããã§ã¯ãããŸããã ãmyMap.setZoomïŒ15ïŒ;ããšããè¡ãã³ã¡ã³ãã¢ãŠããããšããããã«ã¯0çªç®ã®çž®å°ºã衚瀺ãããŸãã èå³æ·±ãããšã«ãã¿ã€ã«ã¯ããã«ããŒããéå§ããŸããïŒ ç§ãã¡ã¯ã¹ããã¡ãŒãèŠã-ã¯ãã確ãã«ã ãã©ãŠã¶ã¯2çµã®ã¿ã€ã«ãåºåããŸãã1ã€ã¯0ã¹ã±ãŒã«çšã§ããã1ã€ã¯15ã¹ã±ãŒã«çšã§ããã©ããããããäžæ£ç¢ºã§ãã ä»åŸïŒsetCenterã§ãºãŒã ãèšå®ã§ããŸããããã®æ å ±ã«é¢ããããã¥ã¡ã³ããèŠã€ããã®ã¯ç°¡åã§ã¯ãããŸããã
ããã£ã ããã«èª¿ã¹ãŸãã
// : myMap.controls.add(new DG.Controls.Zoom()); // : var myBalloon = new DG.Balloons.Common({ // : geoPoint: new DG.GeoPoint(82.927810142519,55.028936234826), // : contentHtml: '!<br> :)' }); // : var myMarker = new DG.Markers.Common({ // ( , , ): geoPoint: new DG.GeoPoint(82.927810142519,55.028936234826), // , : clickCallback: function() { // : if (! myMap.balloons.getDefaultGroup().contains(myBalloon)) { // : myMap.balloons.add(myBalloon); } else { // , : // : myBalloon.show(); } } }); // : myMap.markers.add(myMarker); });
äžèŠãäœããªãããã«æããŸãã ãã¡ãããããã€ãã®å¥åŠãªç¹ããããŸãïŒhtmlContentã®ä»£ããã«contentHtmlãã³ãŒã«ããã¯ã®ã³ã³ããã¹ããèšå®ã§ããªãïŒã ããããããã§ãããäžã®ãã«ãŒã³ã®äœçœ®ã決å®ããã³ãŒãã¯ç§ã«è¡æãäžããŸããïŒ
if (! myMap.balloons.getDefaultGroup().contains(myBalloon))
ãããããäœãšãç°¡åã§ããïŒ ããšãã°ãIsOpenãã©ã³ã¡ãœãããå®è¡ããŸããïŒ
圌女ã¯äžã«ããªã³ãæã£ãŠããŸã
ããŠãã¯ã€ãã¯ã¹ã¿ãŒããé¢ããŸãããã äžèº«ãèŠãŠã¿ãŸãããã

1.5 KbããªããŒããŒã¯åªããŠããŸãã 200 Kbã®APIã³ãŒãã¯æ£åžžã§ãã ã¿ã€ãã³ã°-ãŸããŸãã 955ãã€ãã®CSS-wtfïŒ
ã»ãšãã©ã®èŠåã¯ãAPIãåããã¹ã¯ãªããããããŒã§ãã ãã£ãã·ã³ã°ãªã-å¥åŠãªã æåŸã®å€æŽã®æ¥ä»ã¯1æ17æ¥ã§ããããã¯ãããŒãžã§ã³çªå·ãå€æŽããã«ã¹ã¯ãªãããä¿®æ£ãããããšãæå³ããŸããããã¯å°ãªããšãè¯ããããŸããã IPAç£æ»ãä¿®æ£ããæ©äŒã¯ãããŸããã倧èŠæš¡ãªåæ¥ãããžã§ã¯ãã§ã¯ãããã¯äœåã§éåžžã«äžå¿«ãªè² æ ã§ãã ïŒãšããã§ãä»æã2GIS-ovsky API flamp.ruã®ããŒã¿ãã¹ã¿ãŒã§ãã«ãŒãã¯éãããŸããã§ãããçµå±ã®ãšããã泚æãå¿ èŠã§ããïŒ
APIã¯ãã°ããŒãã«ã¹ã³ãŒãã«3ã€ã®å€æ°ãäœæããŸã-DGïŒDolceïŒGabbanaïŒDeutsche GrammophonïŒåå空éã«æé©ã§ã¯ãããŸããïŒãOpenLayersïŒãµãã©ã€ãºïŒïŒããã³$ã
ã³ãŒãã調ã¹ãŸãã 確ãã«ãå€ãè¯ãOpenLayersã«åºäŒããŸãã
決å®ã¯å¥åŠã§ãã ãŸããOpenLayersã¯ããããç©ããã«èšãã°ã人çã«é ãããšã£ãŠããŸãã2012幎ã«ãå€æãšé·ç§»ã䜿çšããã«äœæ¥ããããšã¯ããã§ã«æªãããšã§ãã 第äºã«ãBSDã©ã€ã»ã³ã¹ã¯ããã€ãã®å¶éã課ããŠããŸãïŒhttp://trac.osgeo.org/openlayers/browser/license.txtïŒãããã¯å®éã«éµå®ããå¿ èŠããããŸãã
$ã¯ããããã¿ã€ãããã°ããŒãã«ãšãªã¢ã«è¡šç€ºãããŸãã å°ãªããšããã«ã¹ã¿ã jQueryã$ã«æ¥ç¶ãããšããããã圌ã§ããããšãããããŸãïŒããã§ã¯ããããã¿ã€ãã®ååšã®çè·¡ãåžžã«åé€ã§ããªãã®ã¯äœã§ããïŒã
ã¡ãªã¿ã«ãã¬ã€ã¢ãŠãã¯ã©ã®ããŒãžã§ã³ã®IEã§ãåäœã¢ãŒãã«ãªããŸã-APIã§QMããµããŒãããããšãäŸç¶ãšããŠæãŸããã§ãã
ã¿ã€ã«èªäœã¯å°ããããããã20 KBã§ãã ãã¹ã¯ãããããŒãžã§ã³ããåŸããšæãããã¬ã³ããªã³ã°ã

äžæ¹ã§ã¯ãåºè³ªã¯ãŠã§ããããã³ã°ã®ããã«éåžžã«è¿ä»£çã«äœãããŠããŸã-ã°ãŒã°ã«ã«äŒŒãã°ã¬ãŒã®è²èª¿ã§ã詳现ã§éè² è·ã«ãªãããããŸãã³ã³ãã©ã¹ãããããŸããã
äžæ¹ããã©ã³ããšãµããã¯ã»ã«ã¢ã³ããšã€ãªã¢ã·ã³ã°ã®æäœã¯ã²ã©ãã§ãã ããã«ããµãŒããŒãžã®pingã¯éåžžã«å€§ãããªããŸãã
座æšã®é åºã¯é·ç·¯åºŠã§ãã Googleã®ãããªçé¢æ圱æ³ããYandexã®ãããªæ¥åæ圱æ³ã¯ã©ã¡ãã ãããïŒ ããã¥ã¡ã³ãã«ã¯çãããããŸããã ç§ãã¡ã¯ãYandexãã€ããªãããäžéšã«æŒãä»ããããšããŸã-ã¿ã€ã«ã¯åå²ããŸãã ããã«ãããããããæ圱ã¯ç圢ã§ãã ãŠãŒã¶ãŒã¬ã€ã€ãŒã«é¢ããããã¥ã¡ã³ãã§ãããã«ã€ããŠã®èšèã§ã¯ãªãããŠãŒã¶ãŒã¯ã©ã®ããã«ã¿ã€ã«ãã«ããããå¿ èŠããããŸããïŒ ã©ã³ãã ã«ïŒ
ããã£ã æºåãå®äºãããã次ã«é²ã¿ãŸãã
çŽå ¥ç¯å²
ã ãããæ©èœããäžããããŸãïŒ
- ã«ãŒãèªäœã
- ã¿ã°
- ã°ã©ãã£ãã¯ã¹;
- ã³ã³ãããŒã«ïŒãŸãã¯ãã³ã³ãããŒã«-ãºãŒã ïŒ;
- å±€
- AJAXãªã¯ãšã¹ãã®APIã
- æ€çŽ¢ã
éå§ããã«ã¯ãååãšããŠãAPIã¯æ£åžžã§ãã äºåã«ã€ã³ã¹ããŒã«ãããã³ã³ãããŒã«ã®æ¬ åŠã ãã«é©ãã-ãããããæéããããŸããã§ãããïŒ
ããã¥ã¡ã³ããèªã¿ãŸãã Point-GeoPointã«é¢ããã»ã¯ã·ã§ã³ã¯ã¹ãããããŸãããã¹ãŠãæšæºã§ãã ããã§ã®ã¿ãèšèšã«åãçµãããšãã§ããŸããã¯ã©ã¹ã€ã³ã¿ãŒãã§ã€ã¹ã®èª¬æãèªãããšã¯å®å šã«äžå¯èœã§ãããã¹ãŠãããŒãžãããŸãã

ãããããã»ã¯ã·ã§ã³ã«é²ã¿ããã¯ããã«ã-ãã©ã€ãã©ãªã®ããŠã³ããŒãã-ãã©ã€ãã©ãªã®ããŒãžã§ã³ããèŠã€ããŸãã ããããããããã»ã¯ã·ã§ã³ã«è¡šç€ºããã®ã¯ã©ããããããäºæ³å€ã§ãããïŒ
次ã«ãDG.autoloadé¢æ°ã䜿çšããŠãã«ãŒãã®åæåã³ãŒããé 眮ããŸãã
[ã³ãŒã]
ãã®æ¹æ³ã¯ããã¯ã€ãã¯ã¹ã¿ãŒããã»ã¯ã·ã§ã³ã§æ€èšãããŸããã ãã ããDG.autoloadé¢æ°ã«ã¯äžå®ã®å¶éããããŸããå éšã§ã¯ãwindow.onloadã€ãã³ããã³ãã©ãŒã䜿çšããŸãã ãããã£ãŠãwindow.onloadãã³ãã©ãŒãããŒãžã§æ¢ã«å®çŸ©ãããŠããå Žåã競åãçºçããŸãïŒãããã®ç«¶åãåé¿ããã«ã¯ãæ¢åã®window.onloadãã³ãã©ãŒã«ã«ãŒãåæåã³ãŒããæ¿å ¥ã§ããŸãïŒã
WTFïŒ window.onloadãåå®çŸ©ããçç± æžã
window.attachEvent && window.attachEvent('onload', callback) || window.addEventListener('load', callback, false);
ããã¥ã¡ã³ãã®ãã®æ®µèœãããé«éã«ãªããŸãã ãããããã®ã¡ã¢ãã¯ã€ãã¯ã¹ã¿ãŒãããåé€ãããã®ã¯ãªãã§ãã-ããå€ãã®ãŠãŒã¶ãŒããã®ã¬ãŒããèžãã ã®ã§ããïŒ äœãèããã«ã
ç¶ããèªãïŒ
ãããã®äžå¿ãèšå®ããã«ã¯ãsetCenterãããã¡ãœãããåŒã³åºããŸãã
// point:myMap.setCenter(point);
ããã€ã³ãïŒããšã¯äœã§ããïŒ ããããªã
ã«ãŒããåé€
myMap.destroyïŒïŒ
ãããã«å«ãŸãããã¹ãŠã®ãªããžã§ã¯ããç Žå£ããŸãã ãã®ã¡ãœãããåŒã³åºããåŸã«myMapãªããžã§ã¯ãèªäœãç Žæ£ããã«ã¯ãããããªããžã§ã¯ãã«nullãå²ãåœãŠãããšããå§ãããŸãã
// . , ID: var myMap = new DG.Map("myMapId"); // . DOMElement : var container = document.getElementById("myMapId"); // , DOM var myMap = new DG.Map("container"); // , ID var myMap = new DG.Map("myMapId");
ã©ã®ãããªå¥åŠãªã³ãŒãã§ããïŒ åœŒã¯ç Žå£ãšäœã®é¢ä¿ããããŸããïŒ çãããåºæ¬ã¯ã©ã¹ã®ããã¥ã¡ã³ããèªãå¿ èŠããããŸãã
ã€ãã³ããã³ãã©ãŒãè¿œå ãã
myMap.addEventListenerïŒobjectIdãeventTypeãã³ãŒã«ããã¯ïŒ
ãã©ã¡ãŒã¿ïŒ
objectId Stringãã³ãã©ãŒãã¢ã¿ããããDOMèŠçŽ ã®èå¥åã
ã®ã£ãããã³ãã¬ãŒãã ã€ãã³ããã³ãã©ãŒããããã«ã¢ã¿ãããããšãã«DOMèŠçŽ ãæå®ããå¿ èŠãããã®ã¯ãªãã§ããïŒ map.getContainerIdïŒïŒä»¥å€ã®IDãæå®ããå Žåãäœãæ©èœããŸããã ãŠãŒã¶ãŒã«å¯Ÿããããçš®ã®æŽåã
å°å³ãåã«ç§»å
myMap.moveNïŒmoveStepïŒ
ãã©ã¡ãŒã¿ïŒ
moveStep Numberã¯ãããããåã«ã·ãããããã¯ã»ã«æ°ã«ããã¹ãããã
åã³ã®ã£ãããã¿ãŒã³ã åãžã®ãã¯ã»ã«-ããã¯ã©ãã§ããïŒ åãžã®åŒ§ã®è§åºŠ-ç§ã¯ç解ãããã¯ã»ã«ãäž-ç§ã¯ç解ããåãžã®ãã¯ã»ã«-ç§ã¯ç解ããŠããŸããã ãŸãããã®æ¹æ³ã®ååšã®æå³ã¯ç§ãå ããŸãã
æå°ãºãŒã ãèšå®ãã
myMap.setMinZoomïŒminZoomïŒ
ãã©ã¡ãŒã¿ïŒ
minZoom Numberã¯ãå¯èœãªæå°ã®ãºãŒã ä¿æ°ã èš±å¯ãããæå°å€ã¯1ã§ãã
æå°èš±å®¹å€ã¯1ã§ããºãŒã ã³ã³ãããŒã«ã1æªæºã®ã¹ã±ãŒã«ãèšå®ããŸããã ãã ãããããã®åæåäžã«çž®å°ºãèšå®ããªããšã0ã«ãªããŸãã ã©ãã ããã ã¡ãªã¿ã«ã0çªç®ã®ã¹ã±ãŒã«ã§ã¯ãgetBoundsã¯å°å[-268ã434]ãçµåºŠã§ãããããŸãã180床ãè¶ ããçµåºŠã¯ã©ã®ããããããŸããïŒ
å°å³ã®å¢çç·ã«å¶éãèšå®ãã
myMap.setBoundsRestrictionsïŒå¢çãisChangePositionïŒ
isChangePositionïŒ ãŸã è±èªã®åéã§ãªããã°ãªããŸããã
ã€ãã³ã
ãã§ã«addEventListenerã®å¥åŠãªããšã«åºäŒã£ãŠããŸãã ããã«-ããã«ïŒaddEventListenerã¯ããã§ãããremoveEventListenerã¯ããã§ã¯ãããŸããã ãªãDOMåã䜿çšããŠãŠãŒã¶ãŒã誀解ãããã®ã§ããïŒ
ã€ãã³ãåã¯ããDgClickã-g smallã®ããã«èšè¿°ããå¿ èŠããããŸãã ä»ã®ãã¹ãŠã®å Žæã§ã¯ãDGã¯åžžã«å€§æåã§ç¶ŽãããŠããŸã-è¿·æãªã»ã©äžè²«æ§ããããŸããã ã¡ãªã¿ã«ããã®äŸã§ããã«ãŒãã¯ãºãŒã ãªãã§åæåãããŸãã
ã»ãšãã©ãã¹ãŠã®ã€ãã³ãã«ã¯ç¬èªã®ã¿ã€ãããããŸãã éåžžã«å€ãã®ã¯ã©ã¹ãæã£ãŠãããšããæèŠã¯ç§ãéããŸãã ããšãã°ãDG.Events.Mapã«ïŒæå°|æ倧ïŒãºãŒã ãååŸããããã«èŠæ±ã§ããŸã-ãªãã§ããïŒ ãã®æ©èœãå¿ èŠãªã®ã¯èª°ã§ããïŒ
ããŒã«ãŒ
ã³ã³ã¹ãã©ã¯ã¿ãŒ
ãã©ã¡ãŒã¿ïŒ
options.geoPoint DG.GeoPointããŒã«ãŒãæããã€ã³ãã®å°ççäœçœ®ã
options.icon DG.IconããŒã«ãŒç»åã DG.Iconã¯ã©ã¹ã«ã€ããŠã¯ã以äžã§è©³ãã説æããŸãã ã¢ã€ã³ã³ãæå®ãããŠããªãå Žåãããã©ã«ãã®ç»åã䜿çšãããŸãã
options.clickCallback FunctionããŒã«ãŒãã¯ãªãã¯ããããšãã«åŒã³åºããããã³ãã©ãŒã é¢æ°åŒã³åºãã³ã³ããã¹ãïŒãŠã£ã³ããŠãªããžã§ã¯ãã
ãã¡ãããã¯ãªãã¯æã®ã³ãŒã«ããã¯ã¯äŸ¿å©ã§ãã ãããããã®åŸãå®éã«ããã«é²ãã§ãå°ãªããšãmouseenter / mouseleaveã§ã³ãŒã«ããã¯ãè¡ãå¿ èŠããããŸãã
åããŒã«ãŒã¯ç¹å®ã®ã°ã«ãŒãã«å±ããŠããå¿ èŠããããŸãã ããã«ãããã°ã«ãŒãæäœãå®è¡ã§ããŸãã ããšãã°ã2çš®é¡ã®ããŒã«ãŒããããŸãã1ã€ã¯é«å±€ãã«çšããã1ã€ã¯æ°å®¶çšã§ãã åè ã1ã€ã®ã°ã«ãŒãã«é 眮ããåŸè ãå¥ã®ã°ã«ãŒãã«é 眮ããããšã«ãããåããŒã«ãŒã»ãããæ瀺çã«æäœã§ããŸãã
ãã¡ãããããŒã«ãŒã®ã°ã«ãŒãåã¯äŸ¿å©ã§ãã ãããããªãã°ã«ãŒããã°ã«ãŒãã«ãã¹ãã§ããªãã®ã§ããïŒ ããã¯ããã«äŸ¿å©ã§ãããããã©ã«ãã°ã«ãŒããæã€å¿ èŠããªããªããŸãã
ãã©ã³ãã°ã©ãã£ãã¯ã¹ãã¬ã€ã€ãŒã«ã¯ãŸã£ããåãã°ã«ãŒããå©çšã§ããããšã«æ³šæããŠãã ããã ãããããã¹ãŠå¥ã ã«èšè¿°ããã®ã¯ãªãã§ããïŒ å ±éã®åºæ¬ã¯ã©ã¹Groupããã³GroupManagerãå ¥åãããšãããã¥ã¡ã³ããååã«ãªããŸãã
ã°ã«ãŒãå ã®åããŒã«ãŒã«å¯ŸããŠæäœãå®è¡ããŸãã
myGroup.forEachïŒã³ãŒã«ããã¯ãã³ã³ããã¹ãïŒ
ãšãã ã ä»ã®ã¡ãœããã§ã¯å®è¡ã³ã³ããã¹ããæå®ã§ããŸããã§ããããããã§ã¯æå®ã§ããŸãã ãã©ãŠã¶ã®Array.forEachãšåæ§ã§ããïŒ ããã§ã¯ãaddEventListenerã§å§ãŸãä»ã®ãã¹ãŠã®ã¡ãœããããã©ãŠã¶ãŒã®çœ²åã«ãã£ã¹ãããå¿ èŠããããŸãã ãšããã§ãJS 1.6ã§ã¯ãforEachã®ã³ã³ããã¹ããã©ã¡ãŒã¿ã¯ãªãã·ã§ã³ãšã¯ç°ãªããŸãã
ãã©ã³
ãã«ãŒã³ãäœæããäŸãèããŠã¿ãŸãããã
// : var myBalloon = new DG.Balloons.Common({ // , : geoPoint: new DG.GeoPoint(82.927810142519,55.028936234826), // : contentHtml: '! :)' }); // : myMap.balloons.add(myBalloon);
ã³ãŒãã®äžå€®ã«ãã空ã®è¡ã¯ãïŒã¯ã€ãã¯ã¹ã¿ãŒãã§ã¯ãªãïŒãšã¹ã±ãŒãããã®ãå¿ãã<br>ã§ãã ç¹°ãè¿ããŸãããé¢åã§ã-äŸã¯çŸåšåäœããŠããŸããã
ãã©ã³ã®ãã©ã¡ãŒã¿ãŒã¯ãè±èªãšåžžèïŒisClosed-ã¯ãã¹ã衚瀺ãããã©ãããcontentSize-ãµã€ãºãåºå®ãããŠãããã©ããïŒã®èªç±ãªäœ¿çšã«åã³é©ãããŠããŸãã
ãã«ãŒã³ã«ã€ãã³ãããªãïŒãŸãã¯èšè¿°ãããŠããªãïŒã®ã¯èå³æ·±ãããšã§ãã
ãã³ãã¯ãããŸããã ãããã圌ãã¯å·ã€ããªãã§ãããã
幟äœåŠ
ãžãªã¡ããªã«ã€ããŠæªãèšèãèšãããšã¯ãããŸãããå¹ åºãã«ã¹ã¿ãã€ãºãªãã·ã§ã³ïŒlinecapãªãã·ã§ã³-ãã¬ãŒã¯ãã€ã³ãã§ã®äžžç·ã®éžæ-åºäŒã£ãããšã¯ãªãããã§ãïŒãåãããåªããå å®ãªã°ã©ãã£ãã¯ã©ã€ãã©ãªã§ãã ã€ãã³ãããªãããšã¯é©ãã¹ãããšã§ã¯ãããŸããã ïŒããããããã¯ãªãé©ãã¹ãããšã§ããããïŒåé¡ã¯ç¥ãããŠããŸã-éæãªãã£ã³ãã¹/ svgã³ã³ããã§ãããããèªäœãã«ããŒããŠããŸãã解決æžã¿:)ïŒã å·Šã«èª¿æ»ãè¿œå ããŸãã
ã³ã³ãããŒã«
ããžã·ã§ãã³ã°ã³ã³ãããŒã«ã¯ããŠãŒã¶ãŒã®è³ã«å¯ŸããæŽåã®ãã1ã€ã®äŸã§ãã
myMap.controls.add(new DG.Controls.Zoom(), null, new DG.ControlPosition(DG.ControlPosition.TOP_RIGHT, new DG.Point(20,10)))
ãããŠãããããã¹ãŠã³ã³ãããŒã«ããŠãå³é ã«20.10ã®ãªãã»ãããä»ããŸãã
ããã°ãã©ã¶ãŒãºãåããã©ã©ã€ã«ãæã£ãŠããããšãç解ããŠããŸã-ããããããã¯å€±æãã決å®ãã³ããŒããçç±ã§ã¯ãããŸããã ãªã代ããã«
new DG.ControlPosition(DG.ControlPosition.TOP_RIGHT, new DG.Point(20,10)))
æžããªãã§
'topright', [20, 10]
ïŒ
ãŸãã¯ãã®ããã«ïŒ
{ top: 20, right: 10 }
ïŒ
åæã«ãcontrols.addã§ã°ã«ãŒãåã®ä»£ããã«nullãæžã蟌ãŸãªãããã«ããã®èšå®ãã³ã³ãããŒã«ã³ã³ã¹ãã©ã¯ã¿ãŒã«èšå®ããŸããïŒ
ã³ã³ãããŒã«ã®ãã¡ããºãŒã ã®ã¿ã䜿çšå¯èœã§ã-æ®ãã®æéã¯ãããŸããã§ãããïŒ ãŸãã¯ãã¬ã€ã¢ãŠããã¶ã€ããŒã«åé¡ããããŸããïŒ ã©ããããçµã¿èŸŒã¿èŠçŽ ã®äžè¶³ãè£ãããã«ãã«ã¹ã¿ã èŠçŽ ãäœæããããã®ã€ã³ã¿ãŒãã§ãŒã¹DG.Controls.AbstractãéããŸããã
ã¡ãªã¿ã«ãæ°ããDG.Controls.AbstractïŒïŒãã«ãŒãã«è¿œå ããããšããŸãã-æ£åžžã«æ©èœããäŸå€ãã¹ããŒããŸããã§ããã ãããã£ãŠãããã¯æœè±¡çã§ã¯ãªããåºæ¬ã§ãã æ¡åŒµã¯ã©ã¹ã®ç¶æ¿ã¡ãœãããæœè±¡ã¯ã©ã¹ã«ãã€ã³ãããããšã¯æ£ãã解決çã§ã¯ãªãããã§ã-ããã¯å®å šã«æ®éçãªã¡ãœããã§ããããããã®äœ¿çšãç¹å®ã®ã¯ã©ã¹ã«å¶éããçç±ã§ãã
ã€ã³ã¿ãŒãã§ã€ã¹èªäœã¯éåžžã«å¥å šã«èŠããŸã-ãã«ããŒgetStatesïŒïŒ/ setStateïŒïŒããŸã£ãã圹ã«ç«ããªãå Žåãé€ããŸãã
ã¬ã€ã€ãŒ
ãããAPIã䜿çšãããšãå°çãããã¬ã€ã€ãŒã®äžã«ã«ã¹ã¿ã ã¬ã€ã€ãŒããªãŒããŒã¬ã€ã§ããŸãã ããã«ãããã»ãŒãã¹ãŠã®ãªããžã§ã¯ããã«ãŒãããšãªã¢ãå°å³ã«è¡šç€ºã§ããŸãã ããšãã°ãã€ã³ã¿ãŒããããããã€ããŒãéœåžã®ã«ãã¬ããžãšãªã¢ã衚瀺ããããåºèããã¶åºã®é éãšãªã¢ãé éã®æéãšè²»çšãšãšãã«ã°ã©ãã£ã«ã«ã«è¡šç€ºãããããã®ã¯ç°¡åã§ãã ãŸãããªãã£ã¹ãžã®éãåžå ãã¢ãŒã®ã«ãŒãã瀺ãããšãã§ããŸãã èŠããã«ãå¯èœæ§ã¯æ³ååã«ãã£ãŠã®ã¿å¶éãããŸãã
...ãã§ã«ããã£ãããã«ãäºæž¬ãæšæž¬ããå¿ èŠããããŸãã
options.countTileServers Numberã¿ã€ã«ãµãŒããŒã®ãµããã¡ã€ã³ã®æ°ã
ãã©ãŠã¶ã¯ã1ã€ã®ãã¡ã€ã³ããåæã«ããŠã³ããŒãããããã¡ã€ã«ã®æ°ã«å¶éããããŸãã ãã®å¶éãåé¿ããã«ã¯ãããã€ãã®ãµããã¡ã€ã³ããã¿ã€ã«ãããŠã³ããŒãã§ããŸãã ãããã®èªã¿èŸŒã¿é床ãæé©åããã«ã¯ããã®å€ã4ã«èšå®ããããšã匷ããå§ãããŸãã
ãã®ãã©ã¡ãŒã¿ãŒã¯ãoptions.tilePrefixãã©ã¡ãŒã¿ãŒãšçµã¿åãããŠäœ¿çšââãããŸãã ããã©ã«ãã§ã¯ãoptions.countTileServersã¯ãŒãã§ããã¿ã€ã«ã¯1ã€ã®ãµãŒããŒããããŠã³ããŒããããŸãã
options.tilePrefixæååã¿ã€ã«ãµãŒããŒã®ãµããã¡ã€ã³ã®ååã®ãã¬ãã£ãã¯ã¹ã
ããšãã°ãurlãã©ã¡ãŒã¿ã¯httpïŒ//example.com/$ {z} / $ {x} / $ {y} .pngã§ãã options.tilePrefixãmytileãšããŠå®çŸ©ãããšãhttpïŒ//mytile1.example.com/ãhttpïŒ//mytile2.example.com/ãhttpïŒ//mytile3.example.com/ã®åœ¢åŒã§ã¿ã€ã«ãµãŒããŒã®ãµããã¡ã€ã³ã®URLãååŸããŸãã以äžãoptions.countTileServersãã©ã¡ãŒã¿ãŒã«å¿ããŠã ãããã£ãŠããã®ãã©ã¡ãŒã¿ãŒã¯ãoptions.tilePrefixãã©ã¡ãŒã¿ãŒãšçµã¿åãããŠäœ¿çšââãããŸãã
ã㌠ã©ããªéæ³ïŒ httpïŒ// mytile $ {n} .example.com / $ {z} / $ {x} / $ {y} .pngïŒ
ã¢ã€ãã¯ã¹
AJAX APIã®æå³ã¯å®å šã«ã¯ç解ãããŠããŸããã ä»»æã®ãã¬ãŒã ã¯ãŒã¯ã®ajax-apiããã䟿å©ã§æ©èœçã§ãããªãå°å³äœæAPIããã®ã¯ãªã¢ãªã³ã°ã«ç»ãå¿ èŠãããã®ã§ããããïŒ ãšããã§ãã¿ã€ããã¹ããããŸã-倱æããŸããã
äžè¬çã«
å šäœçã«ã2GIS APIã¯äºéã®å°è±¡ãæ®ããŸãã
äžæ¹ã§-ã¯ããçæéã§éçºãããæ¬æ ŒçãªAPIã§ãåªããæ©èœã³ã³ããŒãã³ãïŒããŒãºã®90ïŒ ãã«ããŒïŒãåããŠãããæ¡åŒµã®äœå°ããããŸããã
ä»æ¹ã§ã¯ïŒ
- å€ãã®ã€ã³ã¿ãŒãã§ã€ã¹ã®æèã®æ¬ åŠãšççŸã
- ã«ãã¯ã¢ã³ããã£ãŒã«ãšåŒã°ãããã®ãç¡èŠ-ãã°ããºããå°å³ãšUIã®ã»ã¯ã·ãŒãªãã¶ã€ã³ã
- äžæ£ç¢ºãªããã¥ã¡ã³ããå°æ°ã®äŸ;
- APIã®äžéšãšããŠå®éã®2GISããŒã¿ãæäœããããã®ããŒã«ã®äžè¶³ã