Logicify / jquery-locationpicker-plugin

JQuery Location Picker plugin
MIT License
389 stars 260 forks source link

How to add HTML5 Geolocation? #49

Closed ollie007 closed 8 years ago

ollie007 commented 9 years ago

How to add HTML5 Geolocation?

How do i add the HTML5 Geolocation in order to initialise the start location to the user location?

nevenne commented 9 years ago

will you use some database to track

ollie007 commented 9 years ago

there is the geolocation function in newer browsers

navigator.geolocation.getCurrentPosition(function(position) {

not sure that fires quick enough for this script

ollie007 commented 9 years ago

Someone correct this code for me thanks, not working

$.fn.locationpicker.defaults = {
            var _myLat;
            var _myLong;
                navigator.geolocation.getCurrentPosition(function(position) {
                    var _myLat = position.coords.latitude;
                    var _myLong = position.coords.longitude;
                });

    location: {latitude: _myLat, longitude: _myLong},
nevenne commented 9 years ago

https://cordova.apache.org/docs/en/2.5.0/cordova_geolocation_geolocation.md.html

On Sat, Oct 3, 2015 at 9:30 AM, ollie007 notifications@github.com wrote:

Someone correct this code for me thanks, not working

$.fn.locationpicker.defaults = { var _myLat; var _myLong; navigator.geolocation.getCurrentPosition(function(position) { var _myLat = position.coords.latitude; var _myLong = position.coords.longitude; });

location: {latitude: _myLat, longitude: _myLong},

— Reply to this email directly or view it on GitHub https://github.com/Logicify/jquery-locationpicker-plugin/issues/49#issuecomment-145211762 .

ollie007 commented 9 years ago

SO why wont it pass the location to the defaults?

nevenne commented 9 years ago

add my skype call me

On Sat, Oct 3, 2015 at 9:33 AM, ollie007 notifications@github.com wrote:

SO why wont it pass the location the defaults?

— Reply to this email directly or view it on GitHub https://github.com/Logicify/jquery-locationpicker-plugin/issues/49#issuecomment-145211885 .

ollie007 commented 9 years ago

i dont skype LOL check the script

ollie007 commented 9 years ago

maybe i need some quote characters?

nevenne commented 9 years ago

i need more informations

On Sat, Oct 3, 2015 at 9:37 AM, ollie007 notifications@github.com wrote:

maybe i need some quote characters?

— Reply to this email directly or view it on GitHub https://github.com/Logicify/jquery-locationpicker-plugin/issues/49#issuecomment-145211958 .

nevenne commented 9 years ago

did you add plugin

On Sat, Oct 3, 2015 at 9:37 AM, App happy hour nevsak9@gmail.com wrote:

i need more informations

On Sat, Oct 3, 2015 at 9:37 AM, ollie007 notifications@github.com wrote:

maybe i need some quote characters?

— Reply to this email directly or view it on GitHub https://github.com/Logicify/jquery-locationpicker-plugin/issues/49#issuecomment-145211958 .

ollie007 commented 9 years ago

i am hacking the script to add in the geolocation codes

nevenne commented 9 years ago

do you have whatsup

On Sat, Oct 3, 2015 at 9:39 AM, App happy hour nevsak9@gmail.com wrote:

did you add plugin

On Sat, Oct 3, 2015 at 9:37 AM, App happy hour nevsak9@gmail.com wrote:

i need more informations

On Sat, Oct 3, 2015 at 9:37 AM, ollie007 notifications@github.com wrote:

maybe i need some quote characters?

— Reply to this email directly or view it on GitHub https://github.com/Logicify/jquery-locationpicker-plugin/issues/49#issuecomment-145211958 .

ollie007 commented 9 years ago

how do you add plugins to this script??

locationpicker.jquery.js
nevenne commented 9 years ago

ok tell me do you making cordova or what thats why i insiste skype call i dont have enough informations

On Sat, Oct 3, 2015 at 9:40 AM, ollie007 notifications@github.com wrote:

how do you add plugins to this script??

locationpicker.jquery.js

— Reply to this email directly or view it on GitHub https://github.com/Logicify/jquery-locationpicker-plugin/issues/49#issuecomment-145212042 .

nevenne commented 9 years ago

https://plugins.jquery.com/locationpicker/

On Sat, Oct 3, 2015 at 9:41 AM, App happy hour nevsak9@gmail.com wrote:

ok tell me do you making cordova or what thats why i insiste skype call i dont have enough informations

On Sat, Oct 3, 2015 at 9:40 AM, ollie007 notifications@github.com wrote:

how do you add plugins to this script??

locationpicker.jquery.js

— Reply to this email directly or view it on GitHub https://github.com/Logicify/jquery-locationpicker-plugin/issues/49#issuecomment-145212042 .

ollie007 commented 9 years ago

LOOk there is enough info, you gave me the site to get the geolocation so add it to

locationpicker.jquery.js
Sumragen commented 8 years ago

@ollie007 hi! It's to simple. If you want get user location just write that

if(navigator.geolocation){
    navigator.geolocation.getCurrentPosition(function (position) {
       //do something
    })
}