How Can I Get marker on current location in map in Sencha-Touch2.0

后端 未结 3 1814
不思量自难忘°
不思量自难忘° 2020-12-20 21:11

Hey friends i m new to Sencha Touch platform.

And I want to find user current location with marker please help me out. i s

3条回答
  •  误落风尘
    2020-12-20 21:45

    It's a lot simpler if you just use Ext.Map.getGeo() as follows:

        var geo = extmap.down("#Map").getGeo();
        var currentPosition = new google.maps.LatLng(geo.getLatitude(), geo.getLongitude());
    

    As long as you have your map instantiated, it should get the current location if the browser client allows for you to obtain that.

    HTH!

提交回复
热议问题