123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596(* Js_of_ocaml library
* http://www.ocsigen.org/js_of_ocaml/
* Copyright (C) 2015 Stéphane Legrand
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)open!ImporttypepositionErrorCodetypewatchIdclasstypecoordinates=objectmethodlatitude:floatJs.readonly_propmethodlongitude:floatJs.readonly_propmethodaltitude:floatJs.optJs.readonly_propmethodaccuracy:floatJs.readonly_propmethodaltitudeAccuracy:floatJs.optJs.readonly_propmethodheading:floatJs.optJs.readonly_propmethodspeed:floatJs.optJs.readonly_propendclasstypeposition=objectmethodcoords:coordinatesJs.tJs.readonly_propmethodtimestamp:Js.dateJs.readonly_propendclasstypepositionOptions=objectmethodenableHighAccuracy:boolJs.writeonly_propmethodtimeout:intJs.writeonly_propmethodmaximumAge:intJs.writeonly_propendclasstypepositionError=objectmethod_PERMISSION_DENIED_:positionErrorCodeJs.readonly_propmethod_POSITION_UNAVAILABLE_:positionErrorCodeJs.readonly_propmethod_TIMEOUT:positionErrorCodeJs.readonly_propmethodcode:positionErrorCodeJs.readonly_propmethodmessage:Js.js_stringJs.tJs.readonly_propendclasstypegeolocation=objectmethodgetCurrentPosition:(positionJs.t->unit)Js.callback->(positionErrorJs.t->unit)Js.callback->positionOptionsJs.t->unitJs.methmethodwatchPosition:(positionJs.t->unit)Js.callback->(positionErrorJs.t->unit)Js.callback->positionOptionsJs.t->watchIdJs.methmethodclearWatch:watchId->unitJs.methendletempty_position_options()=Js.Unsafe.obj[||]letgeolocation=letx=Js.Unsafe.global##.navigatorinifJs.Optdef.testxthenx##.geolocationelsex(* undefined *)letis_supported()=Js.Optdef.testgeolocation