地理位置在IBM工作灯(谷歌地图API) [英] geolocation in IBM worklight (google map api)

查看:189
本文介绍了地理位置在IBM工作灯(谷歌地图API)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚整合谷歌地图API中的移动应用程序工作灯我的js code
功能可能是正确的,但是该折叠式项目,每个设备给一个不同的位置
安卓:阿拉斯加和放大器; IOS利比亚没有GPS触发器
如果我们美元的共同视点P $ pviewed(GPS在Chrome触发),它在一个城市,是远远200公里从我目前的位置给出了一个位置
我怎样才能解决这个问题?

I just integrate google map api in my js code of a mobile application worklight function is probably correct, but the deployant project, each device gives a different location Android: Alaska & IOS Libya without the GPS triggers and if we previewed in common view (GPS triggered in Chrome) and it gives a location in a city that is 200 km far from my current location How can i solve this problem ?

JS code:
     VAR地图;

JS code : var map;

 var latlng;

 var markersArray = new Array();

  function initialize() {

  var mapOptions = {

  center: new google.maps.LatLng(-34.397, 150.644),

  zoom: 8,

  mapTypeId: google.maps.MapTypeId.ROADMAP
  };


var canvas = document.getElementById("map_canvas");

map = new google.maps.Map(canvas, mapOptions);


 locateCurrentPosition();
  } 
  function onLocationSuccess(position) {


    var locationText = "Lon:" + position.coords.longitude;

     locationText += " Lat:" + position.coords.latitude;


   latlng = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);


   map.panTo(latlng);


   var marker = new google.maps.Marker({

   map : map,

   position : latlng,

   title : 'Current Location'

    });


  google.maps.event.addListener(marker, 'click', function() {

  var infowindow = new google.maps.InfoWindow(

  { content: 'Your location: <br>'+locationText,size: new google.maps.Size(50,50)});

  infowindow.open(map,marker);

   });

    };


    function onLocationFailure(positionError) {

alert('code: ' + positionError.code + '\n' + 'message:'+ positionError.message + '\n');

}

感谢的提前

推荐答案

请参阅如果此实现谷歌地图的工作灯帮助:的http://clearblade.word$p$pss.com/2012/08/06/ibm-worklight-integrating-with-google-maps-11/

See if this implementation of Google Maps in Worklight helps: http://clearblade.wordpress.com/2012/08/06/ibm-worklight-integrating-with-google-maps-11/

也许从这里和<一个提示href=\"http://stackoverflow.com/questions/7452215/geolocation-showing-wrong-location-in-google-map\">here.

这篇关于地理位置在IBM工作灯(谷歌地图API)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆