¥È¥Ã¥×   ÊÔ½¸ Åà·ë º¹Ê¬ ¥Ð¥Ã¥¯¥¢¥Ã¥× źÉÕ Ê£À½ ̾Á°Êѹ¹ ¥ê¥í¡¼¥É   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS

Titanium Mobile/ÃÏ¿Þ

Last-modified: 2018-11-14 (¿å) 15:24:04 (2153d)
Top / Titanium Mobile / ÃÏ¿Þ

Titanium¤Ç¤ÎÃÏ¿Þɽ¼¨ÊýË¡

Titanium¤ÇÃÏ¿Þ¤òɽ¼¨¤¹¤ëÊýË¡¤Ï¿§¡¹Í­¤ê¤Þ¤¹¤¬¡¢£³Ä̤ꤴ¾Ò²ð¤·¤Þ¤¹¡£

ÃÏ¿ÞÁȤ߹þ¤ßÊýË¡¥á¥ê¥Ã¥È¥Ç¥á¥ê¥Ã¥È
Ti.Map¥â¥¸¥å¡¼¥ë¡¦Titaniumɸ½à¤ÎÃÏ¿Þµ¡Ç½¤Ç¥µ¥ó¥×¥ë¤¬Â¿¤¤¤Ç¤¹¡£
¡¦iOS¤ÈAndroid¤Ç¤Û¤ÜƱ¤¸¥×¥í¥°¥é¥à¤È¤Ê¤ê¤Þ¤¹¡£
¡¦¥Ô¥ó(Annotation)¼þ¤ê¤ÎÁàºî¤¬Ë­ÉÙ¡Ê¥Ô¥ó²èÁü¤òÊѤ¨¤¿¤ê¡¢¥Ô¥ó¤ò¥¿¥Ã¥Á¤·¤¿¤È¤­¤ËÀâÌÀ¤Î¥Æ¥­¥¹¥È¤ä²èÁü¤ä¤ò´Þ¤ó¤À¥Ó¥å¡¼¤ò³«¤¯¤Ê¤É¡Ë
¡¦¥½¡¼¥¹¤¬¥·¥ó¥×¥ë¤Ç¥³¡¼¥Ç¥£¥ó¥°¤·¤ä¤¹¤¤¤Ç¤¹¡£¤Þ¤¿¡¢Alloy¤Ç¥Ô¥ó¤ò½ñ¤¯¤³¤È¤â²Äǽ¡£
¡¦¤â¤·Apple MapsÍøÍѤ¬É¬¿Ü¤Î¤È¤­¤ÏÍ£°ì¤ÎÁªÂò»è
¡¦Ti 4.1.0¤«¤é¥Þ¥Ã¥×¾å¤Ë¥é¥¤¥ó¡¦¥Ý¥ê¥´¥ó¡¦¥µ¡¼¥¯¥ë¤òÉÁ²è¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
¡¦iOS¤Ç¤ÏÉϼå¤ÊApple Maps¤È¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
¡¦ÃÏ¿Þ¤ò¥¯¥ê¥Ã¥¯¤·¤¿ÃÏÅÀ¤Î°ÞÅÙ¡¦·ÚÅÙ¤¬¼èÆÀ¤Ç¤­¤Þ¤»¤ó¡£
TiGMap¥â¥¸¥å¡¼¥ë(iOSÀìÍÑ)¡¦iOS¤ÇGoogle Maps¤ò»ÈÍѤǤ­¤Þ¤¹¡£
¡¦¥¿¥Ã¥Á¤äĹ²¡¤·¤·¤¿°ÌÃ֤ΰÞÅÙ¡¦·ÐÅÙ¤¬¼èÆÀ¤Ç¤­¤Þ¤¹¡£
¡¦»ÈÍѷи³¤¬Ìµ¤¤¤¿¤á¤½¤Î¾¾ÜºÙ¤ÏÉÔÌÀ
¡¦iOS¤Î¤ßÂбþ¤Ç¤¹¤Î¤Ç¡¢Android¤Ç¤ÏTi.Map¤ò»È¤Ã¤Æ¥×¥í¥°¥é¥à¤òʬ¤±¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¡¦»ÈÍѷи³¤¬Ìµ¤¤¤¿¤á¤½¤Î¾¾ÜºÙ¤ÏÉÔÌÀ
WebView¤ËGoogle Maps¤òÁȤ߹þ¤à¡¦Æ±¤¸¥×¥í¥°¥é¥à¤ÇiOS¡¢Android¶¦¤ËGoogle Maps¤ò»ÈÍѤǤ­¤Þ¤¹¡£
¡¦Google Maps API¤òÁàºî¤·¤Æ¿§¡¹¤Êµ¡Ç½¤ò»ÈÍѤǤ­¤Þ¤¹¡ÊÎ㤨¤Ð¥¿¥Ã¥Á¤·¤¿ÃÏÅÀ¤Î°ÞÅÙ¡¦·ÐÅÙ¤ò¼èÆÀ¤·¤¿¤ê¡¢ÃϿޤ˥ݥꥴ¥óÉÁ²è¤·¤¿¤ê¡¢£²ÃÏÅÀ¤Î·ÐÏ©¤òɽ¼¨¤·¤¿¤ê¡Ë¡£
¡¦Web¥¢¥×¥ê¤ÇGoogle Maps API¤ò»ÈÍѤ·¤Æ¤¤¤ë³«È¯¼Ô¤Ë¤È¤Ã¤Æ»È¤¤¤ä¤¹¤¤¤Ç¤¹¡£
¡¦Æ±¤¸²èÌ̤ËÃÏ¿Þ¤ò£²¤ÄÇÛÃ֤Ǥ­¤Þ¤¹¡£
¡¦Æ±ÍͤÎÊýË¡¤ÇYahooÃÏ¿Þ API¤âÍøÍѤǤ­¤Þ¤¹¡£
¡¦WebView¤ËÁȤ߹þ¤à¤Î¤Ç¡¢¥×¥í¥°¥é¥àËÜÂΤȤÎÏ¢·È¤¬Ê£»¨¤È¤Ê¤ê¤Þ¤¹¡£

(1) Ti.Map¥â¥¸¥å¡¼¥ë¤òÍѤ¤¤¿ÃÏ¿Þɽ¼¨

Titanium¤Çɸ½àŪ¤ÊÃÏ¿Þɽ¼¨ÊýË¡¤Ç¤¹¡£iOS¤Ç¤ÏApple Maps¡¢Android¤Ç¤ÏGoogle Maps¤Çɽ¼¨¤µ¤ì¤Þ¤¹¡£°ÊÁ°¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç»ÈÍѽÐÍè¤Þ¤·¤¿¤¬¡¢2014-02-20»þÅÀ¤Ç¤Ï¥â¥¸¥å¡¼¥ëÄɲòèÌ̤«¤é¡Öti.map [android, ios] - Global {API Ver. 2}¡×¤òÄɲ䷤ƻÈÍѤ·¤Þ¤¹¡£ ¤Þ¤¿¡¢Alloy¤Î¾ì¹ç¤Ïalloy.js¤Ë¼¡¤Î¹Ô¤òÄɲä·¤Þ¤¹¡£

Alloy.Globals.Map = require('ti.map');

»ÈÍѾå¤Î¤´Ãí°Õ

¸½»þÅÀ(2014-02-20)¤Ç¤ÏTitanium¥Ç¥Õ¥©¥ë¥È¤ÎAndroidÍÑGoogle Maps¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï£±¤Ç¡¢¤³¤ì¤ò£²¤ËÂбþ¤µ¤»¤ë¤¿¤á¤Ë¥â¥¸¥å¡¼¥ë¤ÇÁȤ߹þ¤à¤è¤¦¤ËÊѤï¤Ã¤¿¤½¤¦¤Ç¤¹¡£ºÇ¶á¤Î¿¤¯¤Î¥µ¥ó¥×¥ë¤Ç¤ÏAndroid¤À¤±¤³¤Î¥â¥¸¥å¡¼¥ë¤òÁȤ߹þ¤ß¡¢iOS¤Ï¥Ç¥Õ¥©¥ë¥È¤ÎTi.Map¤Î¤Þ¤Þ¤Èʬ¤±¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£¤·¤«¤·¡¢Î¾¼Ô¶¦Ä̤Ǥ³¤Î¥â¥¸¥å¡¼¥ë¤ò»ÈÍѤ¹¤ë¥½¡¼¥¹¤Ç½ñ¤±¤Þ¤¹¡£

¥ê¥ó¥¯

(2) TiGMap¥â¥¸¥å¡¼¥ë¤òÍѤ¤¤¿ÃÏ¿Þɽ¼¨(iOSÀìÍÑ)

Objective-C¤ÇGoogle Maps¤òÍøÍѤ¹¤ë¾ì¹ç¤Ï¡¢GoogleÄ󶡤ΡÖGoogle Maps SDK for iOS¡×¤ò»ÈÍѤ·¤Þ¤¹¡£TiGMap¤Ï¤³¤ÎSDK¤ò¼è¤ê¹þ¤ó¤ÀiOSÀìÍÑTitaniumÍѥ⥸¥å¡¼¥ë¤Ç¤¹¡£

Google Maps API ¤è¤¯¤¢¤ë¼ÁÌä »ÈÍÑÀ©¸Â¤Î±Æ¶Á¤ò¼õ¤±¤ë Maps API ¥µ¡¼¥Ó¥¹¤ò¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£¤Ç¡ØGoogle Earth API¡¢¤ª¤è¤Ó Android ¤ä iOS ¤Ê¤É¤Î¥â¥Ð¥¤¥ë ¥×¥é¥Ã¥È¥Õ¥©¡¼¥àÍÑ Maps API ¤ÏÂоݳ°¤Ç¤¹¡£Google ¥Þ¥Ã¥×¤ÎËä¤á¹þ¤ßµ¡Ç½¤ä¡¢ÃÏ¿Þ¤ò´Þ¤àËä¤á¹þ¤ßµ¡Ç½¤òÄ󶡤¹¤ë¤½¤Î¾¤Î Google ¥µ¡¼¥Ó¥¹¤Î¤´ÍøÍѤϡ¢¤³¤ì¤é¤Î»ÈÍÑÀ©¸Â¤ÎÂоݤȤϤʤê¤Þ¤»¤ó¡£¡Ù¤ÈÍ­¤ë¤Î¤Ç¡¢ÍøÍѲó¿ô¤ÎÀ©¸Â¤Ï̵¤¤¤è¤¦¤Ç¤¹¡£

»ÈÍѾå¤Î¤´Ãí°Õ

¤½¤Î¤Þ¤Þ¤Ç¤Ï¥Ó¥ë¥É¤Ç¤­¤Þ¤»¤ó¡£module.xcconfig¤Î¥Ñ¥¹½ñ¤­´¹¤¨¤¬Íפê¤Þ¤¹¡£

¥â¥¸¥å¡¼¥ë

  • daisaru11/TiGMap | GitHub ... TiGMap¤Î¥ª¥ê¥¸¥Ê¥ë¤À¤½¤¦¤Ç¤¹¡£¹¹¿·¤Ï»ß¤Þ¤Ã¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£¥³¡¼¥Éµ­½ÒÊýË¡¤Ï¤³¤Á¤é¤ÎReadme¤¬¾Ü¤·¤¤¤è¤¦¤Ç¤¹¡£
  • alperdincer/TiGMap | GitHub ... ¡ùTiGMap¤òfork¤·¤Æºî¤é¤ì¤¿ºÇ¿·ÈǤǤ¹¡£¤³¤Á¤é¤òÍѤ¤¤ë¤Î¤¬ºÇ¿·¤Ç¤¤¤¤¤è¤¦¤Ç¤¹(by ȬÌÚ»á)¡£
  • Google Maps for iOS | Appcelerator Marketplace ... $30¤Ç¤Û¤ÜƱ¤¸»ÅÍͤΤâ¤Î¤¬ÈÎÇ䤵¤ì¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£Â¾¤È¤Î°ã¤¤¤ÏÉÔÌÀ¤Ç¤¹¡£
  • Ti.GoogleMaps ... ¿µ¡Ç½¤ÎiOSÀìÍÑÃϿޥ⥸¥å¡¼¥ë¤À¤½¤¦¤Ç¤¹¡£Appcelerator¼Ò°÷¤Î¤è¤¦¤Ç¡¢¤³¤ì¤¬°ìÈÖ¤¤¤¤¤«¤â¡©

¥ê¥ó¥¯

(3) WebView¤ËGoogle Maps¤òÁȤ߹þ¤ó¤ÀÃÏ¿Þɽ¼¨

¾Ü¤·¤¯¤Ïapp_8.js, map.html¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

Google Maps JavaScript API v3 »ÈÍÑÀ©¸Â¤È¹ØÆþ¤Ë¤è¤ë¤È¡¢90Æü´ÖϢ³¤Ç1Æü¤¢¤¿¤êºÇÂç25,000²ó¤òĶ¤¨¤ë¤ÈÍ­ÎÁ¤È¤Ê¤ë¤è¤¦¤Ç¤¹¡£

¥Þ¥Ã¥×¥µ¥ó¥×¥ë¥½¡¼¥¹ by ȬÌÚ»á

map_8¤À¤±WebView¤ËGoogle Maps¤òÁȤ߹þ¤ó¤ÀÃÏ¿Þɽ¼¨¤Ç¤¹¡£¤½¤ì°Ê³°¤ÏTi.Map¥â¥¸¥å¡¼¥ë¤òÍѤ¤¤¿ÃÏ¿Þɽ¼¨¤Ç¤¹¡£¡Ê¸·Ì©¤Ë¸À¤¦¤Èmap_8¤â°ìÉôTi.Map¥â¥¸¥å¡¼¥ë¤òÍѤ¤¤Æ¤¤¤Þ¤¹¡Ë

app_1.js
°ÞÅÙ·ÐÅÙ¸ÇÄê°ÌÃ֤Υޥåפòɽ¼¨
app_2.js
¸½ºß°ÌÃ֤Υޥåפòɽ¼¨
app_3_1.js
¸½ºß°ÌÃ֤˥ԥó¤òÂǤ俥ޥåפòɽ¼¨
app_3_2.js
¸½ºß°ÌÃ֤˥ԥó¤òÂǤ俥ޥåפòɽ¼¨¤·¡¢10ÉÃËè¤Ë¸½ºß°ÌÃ֤Υԥó¤òÄɲà ... ¼ÂºÝ¤Ë¤ÏTi.Geolocation.getCurrentPosition¤Ï¥­¥ã¥Ã¥·¥å¤µ¤ì¤ë¤Î¤Ç¡¢»È¤¨¤Ê¤¤¤½¤¦¤Ç¤¹¡£
app_4_1.js
¸½ºß°ÌÃ֤ν»½ê¤òɽ¼¨¡£°ÞÅÙ·ÐÅÙ¢ª½»½ê¥Æ¥­¥¹¥È¤ÎÊÑ´¹(reverse geocoding)¤ËGoogle Maps API¤òÍøÍÑ¡£Ti.Geolocation.reverseGeocoder¤ÏÊֵѤµ¤ì¤ë¥Æ¥­¥¹¥ÈÆâÍƤ¬Îɤ¯¤Ê¤¤¤Î¤Ç¡¢¤½¤ÎÂåÂؤǤ¹¡£

Î㤨¤ÐÅìµþ±Ø¤Î°ÞÅÙ¡§35.681382¡¢·ÐÅÙ¡§139.766084¤òÊÑ´¹¤·¤¿¾ì¹ç¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
Ti.Geolocation.reverseGeocoder¤Ï¼¡¤òÊÖ¤·¤Þ¤¹¡£
407, ¿ÀÅĽٲÏÂæ»°ÃúÌÜ, ÀéÂåÅĶè (Chiyoda), Ë̳ë¾þ·´, 100-0005, ÆüËÜ
Google Maps API¤Ï¼¡¤òÊÖ¤·¤Þ¤¹¡£
ÆüËÜ, ÅìµþÅÔÀéÂåÅĶè´Ý¤ÎÆ⣱ÃúÌÜ£¹¡Ý£±
app_5_1.js
ÆþÎϤ·¤¿ÃÏ̾¤ÎÃÏ¿Þ¤òɽ¼¨¡£½»½ê¥Æ¥­¥¹¥È¢ª°ÞÅÙ·ÐÅÙ¤ÎÊÑ´¹(forward geocoding)¤ËGoogle Maps API¤òÍøÍÑ¡£Ti.Geolocation.forwardGeocoder¤ÏÎɤ¯¤Ê¤¤¤Î¤Ç¡¢¤½¤ÎÂåÂؤǤ¹¡£°Ê¹ß¤Î¥µ¥ó¥×¥ë¤Ç¸À¸ì¤ÏÆüËܸ졢Ãæ¹ñ¸ì¡¢ÂæÏѸì¤ËÂбþ
app_7.js
¸½ºß°ÌÃ֤Υޥåפòɽ¼¨¡ÊGoogle Maps API¤Ç¤Î½»½ê¥Æ¥­¥¹¥È¼èÆÀÉÕ¤­¡Ë¡¢ÆþÎϤ·¤¿ÃÏ̾ÃÏÅÀ¤Ë¥Ô¥ó¤òÇÛÃÖ¤·¡¢¸½ºß°ÌÃÖ¤«¤é¤ÎľÀþ¤òɽ¼¨¡£
app_7_1.js
app_7.js¤Îµ¡Ç½¤Ë²Ã¤¨¡¢Æ»½ç¥Ü¥¿¥ó¤ò²¡¤¹¤ÈGoogle Maps API¤Ç¤½¤³¤Þ¤Ç¤ÎÆ»½çºÂɸÇÛÎó¤ò¼èÆÀ¤·¡¢¥ë¡¼¥È¤òɽ¼¨¡£
Ãí°Õ»ö¹à¡§map_8¤Î¾ì¹ç¤ÈÈæ¤Ù¤ÆÅÓÃæ¤òüÀޤ俤êÌÜŪÃϤޤÇÅþ㤷¤Æ¤¤¤Ê¤«¤Ã¤¿¤ê¡¢¤«¤Ê¤ê¤¤¤¤²Ã¸º¤Ê¥Ç¡¼¥¿¤¬Ê֤뤳¤È¤¬¤¢¤ë¤½¤¦¤Ç¤¹¡£
app_8.js, map.html
app_7_1.js¤Îµ¡Ç½¤Ë²Ã¤¨¡¢Æ»½ç¥Ü¥¿¥ó¤ò²¡¤¹¤È¥ë¡¼¥È¤òWebView¤ËÆþ¤ì¤¿Google Maps¤Çɽ¼¨
app_9.js
¥Ô¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥Á¥§¥Ã¥¯¥¤¥ó²èÌ̤òɽ¼¨
app_10.js, arrow.gif
Ìð°õ²èÁü¤Ç¥³¥ó¥Ñ¥¹¤òɽ¼¨


Ãí°Õ¡§Ti.Map¤Ï¥â¥¸¥å¡¼¥ë¤È¤·¤ÆÁȤ߹þ¤à¤è¤¦¤ËÊѤï¤Ã¤¿¤Î¤Ç¡¢tiapp.xml¤Ëti.map¥â¥¸¥å¡¼¥ë¤òÁȤ߹þ¤ß¡¢app.js¤ÎÀèƬ¤Ë¼¡¤Î¹Ô¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£

Ti.Map = require('ti.map');


Ãí°Õ¡§API»ÅÍͤ¬ÊѤï¤Ã¤¿¤¿¤á¡¢app_7.js, app_8.js¤Ç¡Ömap.addRoute({...});¡×¤Î¹Ô¤Ï¼¡¤Î¤è¤¦¤Ë½ñ¤­´¹¤¨¤ëɬÍפ¬Í­¤ê¤Þ¤¹¡£

#pre{{
var route = Ti.Map.createRoute({
color: 'red',
points: [{latitude:geo.lat, longitude:geo.lng}, {latitude:current_position.latitude,longitude:current_position.longitude}],
width: 4,
});
map.addRoute(route);
}}
Ãí°Õ¡§API»ÅÍͤ¬ÊѤï¤Ã¤¿¤¿¤á¡¢app_7_1.js¤Ç¼¡¤Î¤è¤¦¤Ë½ñ¤­´¹¤¨¤ëɬÍפ¬Í­¤ê¤Þ¤¹¡£
£±¤ÄÌÜ¡Ömap.addRoute({name:'Æ»½ç', points:points, color:'Red'});¡×

#pre{{
var route = Ti.Map.createRoute({
color: 'red',
points: points,
width: 4,
});
map.addRoute(route);
}}
£²¤ÄÌÜ¡Ömap.addRoute({...});¡×

#pre{{
var route = Ti.Map.createRoute({
color: 'blue',
points: [{latitude:geo.lat, longitude:geo.lng}, {latitude:current_position.latitude,longitude:current_position.longitude}],
width: 4,
});
map.addRoute(route);
}}

¥ê¥ó¥¯