开发者

geolocation in sencha

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜