开发者

geolocation in sencha

开发者 https://www.devze.com 2023-02-19 03:03 出处:网络
I am making an app in sencha which tracks people on a map. What I would like to know is what I need to track other people. I need their latitude and longitude but I have no idea how to access that.

I am making an app in sencha which tracks people on a map. What I would like to know is what I need to track other people. I need their latitude and longitude but I have no idea how to access that. Does any开发者_开发技巧one have an answer to this?


 var geo = Ext.create('Ext.util.Geolocation', {
     autoUpdate: false,
     listeners: {
         locationupdate: function (geo) {

            var marker = new google.maps.Marker({
                 position: position,
                 map: map,
                 visible: true,
                 animation: google.maps.Animation.DROP,
                 icon: '/Resources/icons/map@20.png',

             });

         },
         locationerror: function (geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
             Ext.Msg.alert('Error', message, Ext.emptyFn);

         }
     }
 });

 geo.updateLocation();


In Sencha Touch, there is a GeoLocation class that takes care of this for you. Have a look at the documentation, which contains also an example of how to use the class. http://dev.sencha.com/deploy/touch/docs/?class=Ext.util.GeoLocation

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号