map "µØͼ¼ÓÔØÖÐ.../div 1¡¢µ÷ÓÃGPS¶¨Î»API£¨×¢Ò⣬ʹÓÃÁË baidu ºÍ bd09l l²ÎÊý£¬ÎÞÐèת»»×ø±ê£© 1 pl" />
HTML5¼¼Êõ

ÀûÓÃHBuilder¿ª·¢»ùÓÚMUIµÄH5+ appÖÐʹÓðٶȵØͼ¶¨Î»¹¦ÄÜ - ³ÌÐòæ¹ÄÀøʦ

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-09-13 09:00 ÎÒÒªÆÀÂÛ( )

¶¨Î»¹¦ÄÜÓÐÁ½ÖÖ·½·¨£º Ê×ÏÈÒª³õʼ»¯ÄÚÖõØͼ£º var map = new plus.maps.Map(" map "); ÕâÀï»ÆÉ«µÄmapÊÇhtmlÀïÃæµÄid£º divbackground-color: #ffff00;">map "µØͼ¼ÓÔØÖÐ.../div 1¡¢µ÷ÓÃGPS¶¨Î»API£¨×¢Ò⣬ʹÓÃÁË baidu ºÍ bd09l l²ÎÊý£¬ÎÞÐèת»»×ø±ê£© 1 pl

¶¨Î»¹¦ÄÜÓÐÁ½ÖÖ·½·¨£º

Ê×ÏÈÒª³õʼ»¯ÄÚÖõØͼ£º

var map = new plus.maps.Map("map");

ÕâÀï»ÆÉ«µÄmapÊÇhtmlÀïÃæµÄid£º

<divbackground-color: #ffff00;">map">µØͼ¼ÓÔØÖÐ...</div>

1¡¢µ÷ÓÃGPS¶¨Î»API£¨×¢Ò⣬ʹÓÃÁËbaiduºÍbd09ll²ÎÊý£¬ÎÞÐèת»»×ø±ê£©

1 plus.geolocation.getCurrentPosition(function(p) { 2 console.log(p.addresses); 3 console.log( p.coords.longitude); 4 console.log( p.coords.latitude); 5 var gpsPoint = new plus.maps.Point( p.coords.longitude, p.coords.latitude); 6 map.centerAndZoom(gpsPoint, 19); 7 8 }, function(e) {}, { 9 provider: 'baidu', coordsType: 'bd09ll' });

2¡¢Ê¹ÓÃh5+ÄÚÖõØͼ½øÐж¨Î»¡£

map.getUserLocation(function(state, pos) { console.log(JSON.stringify(pos)); if(0 == state) { map.centerAndZoom(pos, 16); } });

¡¡¡¡·½·¨1¿ÉÒÔÄõ½¾ßÌåµØÖ·£¬·½·¨2²»ÄÜ£¡£¡

ɨһɨ¹Ø×¢£¬Ò»Æðѧ±à³Ì:

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • JsÀûÓÃCanvasʵÏÖͼƬѹËõ - similar

    JsÀûÓÃCanvasʵÏÖͼƬѹËõ - similar

    2017-09-12 12:00

  • ³ÌÐòÔ±Ò²ÊÇÈõÊÆȺÌ壿¡ª¡ª´ÓWePhone¿ª·¢Õßʼþ˵Æð - ITÃ×·Û

    ³ÌÐòÔ±Ò²ÊÇÈõÊÆȺÌ壿¡ª¡ª´ÓWePhone¿ª·¢Õßʼþ˵Æð - ITÃ×·Û

    2017-09-10 11:03

  • .NET Core¶àƽ̨¿ª·¢ÌåÑé[4]: Docker - Artech

    .NET Core¶àƽ̨¿ª·¢ÌåÑé[4]: Docker - Artech

    2017-09-07 11:57

  • web ¿ª·¢ÖÐ 405±¨´í - wwqqnn

    web ¿ª·¢ÖÐ 405±¨´í - wwqqnn

    2017-09-04 13:07

ÍøÓѵãÆÀ
Ø