What is a Geolocation API and how is it used? - PubNub
文章推薦指數: 80 %
A Geolocation API is a communication interface between a client device or application (client-side), and an application or service (server-side) that ... WatchNow→EventsandActionsislive!Checkoutourwebinaronthisnewfeature.BlogSupportDocumentationLoginPubNubSearch.SolutionsSolutionsDropdownIn-AppChatSecureone-to-one,group,orliveeventin-appchatGeolocationLocation-basedmappingandeventsVirtualEventsEffortlesslyreachlargeaudiencesinrealtimePushNotificationsIn-appalertsandmobilepushnotificationsIoTMonitoringandcontrolofdevicesandsystemsDataStreaming&DashboardsPublish,monitor,andanalyzedatainrealtime.UseCasesUseCasesDropdownGamingEnhanceplayerengagementwithin-gamechatandleaderboardsTelemedicineProvidehigh-qualityremotecarewithHIPAA-compliantchatE-LearningBuildengagingvirtualclassroomswithsharedwhiteboardsandchatLiveEntertainmentCreatelivelyeventsatscalewithunlimitedchannelsandconcurrentusersFleetTransportationandDeliveryOptimizedispatchanddeliverywithreal-timelocationtrackingMarketplacesCapturebuyers’attentionwithreal-timepricingandnotificationsPricing.ResourcesResourcesDropdownBlogCaseStudiesGuideseBooksDatasheetsWhitePapersWebinarsPodcastAboutUs.OurPlatformPlatformExplorePubNubLearnhowthePubNubplatformworksPubNubTourExplorePubNub'scorefeatureswithourinteractiveandlive-codetourSeehowwecompareLearntheuniquefeaturesofPubNubcomparedtootherreal-timeprovidersIntegrationsAdd3rd-partyintegrationswithAPIsyouknowandlovePubNubFunctionsRunserverlessbusinesslogiconyourPubNubmessages.DevelopersDocumentationHomeParentPubNubDevelopersEverythingyouneedtogetbuildingwithPubNubinoneplaceGETSTARTEDDocumentationHomeStartbuildingwithPubNub’sSDKs,APIsand3rdpartyintegrationsHow-ToGuidesGetthemostoutofPubNubwithourhow-toguidesTutorialsBuildyourapplicationwiththesestep-by-stepinstructionsEXPLOREDeveloperPathsAlltheresourcesyouneedinoneplacetobuildreal-timeappsforChat,IoT,Virtualeventsandmore.DemosExplorereal-timedemosforChat,IoT,GeolocationandmoreFixedMenuforNetworkStatusNetworkStatusSearchContactSalesTryforfree. Real-timeTechnologyGlossaryAnever-growingrepositoryoftechnicaltermsaroundreal-timetechnologyandbeyond.Glossary»W»WhatisaGeolocationAPI&howisitused?WhatisaGeolocationAPI? AGeolocationAPIisacommunicationinterfacebetweenaclientdeviceorapplication(client-side),andanapplicationorservice(server-side)thatidentifiesandreturnsinformationabouttheclient’sgeographicalposition.Additionalinformationaboutthelocationsuchastimezone,currencyorcountrycanbedeterminedthroughgeocoding. Itiscalledwhenthereisaneedtoprogrammaticallyconfigureawebormobileapplicationbasedontheuser'slocationandcommonusecasesincludereal-timemapnavigationandgeotracking,servingcontextualadvertisements,implementingusersecuritychecks,andtailoringcontenttocertainregions. TheGeolocationAPIdoesnotstoreanyinformationinitself,butratherprovidestheabilitytogatherexistinginformationfromthedevicebeingqueried.ItcancollectlocationinfofromsourcessuchasIPAddress,GPS,WiFi,Bluetooth,RFID,GSM/CDMAID,oruserinput.OnceanAPIqueryiscompleted,a"best-guess"geographicpositionwithcoordinatesisreturnedtothecallingapplicationinJSON. Note:Ausermustexplicitlygrantpermissionforanapplicationtoaccesstheirlocation. HowDoesaGeolocationAPIWork? GeolocationInputParameters Typically,arequestforlocationinformationtoaGeolocationIPisfromadevice,e.g.acomputerormobilephone,whichprovidesoneormoreofthefollowinginputparameters:anIPaddress,MACaddress,RFID,GPScoordinates,celltower(e.g.GSM,WCDMAorCDMA)IDorWiFiposition.Ausercanalsorequestgeographicpositioninformationaboutaplaceororganizationbyname. GeolocationOutputParameters TheAPIqueriesaLocationInformationServer,whichrepliestoitwithvariouslocationproperties,includingtheaccuracyoftheinformationitispassingon.TheAPIthenreturnsthisinformationtotheclient.WheretheinformationcomesfromistransparenttotheAPIandtheAPIdoesnotitselfstoreanydata. TheinformationatypicalGeolocationAPIprovidesvariesbutmayincludethefollowing: Physicaladdress,throughreversegeocoding-E.g.country,city,region,continent,postalcode,andwhetherthecountryisamemberoftheEU. Latitudeandlongitude-Includingaccuracy,altitude,andspeed. Localdata,throughreversegeocoding-Timezone(includingdaylightsavingtime),language(includingmultipleofficiallanguages)andcurrency(includingcurrencysymbolanddescription)data. Properties GeolocationAPIsareavailableforwebpagesandweb-basedapplicationsdeliveredthroughtheGeolocationpropertywhichispartoftheNavigatorobject. NativeandricherlocationAPIsarealsoavailableforbothAndroidandiOS. All3platforms(web,Android,iOS)willoffer Theabilitytoretrievethecurrentdevicelocation,returnedasalatitude,longitudepairalongwithaccuracy,height,altitude,andspeed(ifknown) Theabilitytowatchforchangesinpositionandregisteracallbacktobeinvokedwhenthedevicepositionchanges AndroidandiOSwillalsodifferentiatebetween‘fine’locationand‘coarse’locationtoenhanceuserprivacyandthetrade-offbetweenperformanceandaccuracy. Whereapplicationusecasesallow,theappshouldusethefeaturewhereacallbackisinvokedwhenausergoesnearalocation(knownas‘visitslocationservice’oniOSand‘geofence’onAndroid)sincethisisthemostpower-efficientAPI. WherenativeorwebAPIsarenotanoption,forexamplewhenrunningonanIoTdevice,thereareamyriadofRESTlocationAPIsavailable UseCases Geolocationisusedprimarilytogeographicallycustomizeauser’sdigitalexperience. BrowserContext-Whenyouaresearchingtheinternet,yourbrowsermaywanttoqueryyourlocationinordertoprovidelocale-specificinformationthatisrelevanttoyourquery,e.g.businesseslocatedinyourareaoftheUnitedStatesorlocalnews. WeatherReports-Ifyouwanttochecktheweatheronyourphone,thedevicewillneedLocationsettoONinthephone’sSettings. SocialMediaUpdates-ApplicationslikeFacebookuselocationAPIssouserscantagtheirlocationsintheirstatusupdates,e.g.showtheirfriendswheretheyarevacationing. EmploymentandBusinessNetworking–Jobsearchingwebsitesusegeolocationtomatchjobsearcherswithopportunitiesavailableintheirarea. DigitalMaps-Lostinastrangecity?UseyourphonetopinpointyourlocationandfindthefastestroutetoyourhotelusingGoogleMaps. MarketingandCustomerEngagement-WebapplicationsuseaGeolocationAPItomonitorauser’spositionwhenthey’reoutandabouttown.Forinstance,whenapersongoesshopping,anapplicationmayalertthemtocurrentspecialsinaparticularstoreorsuggestrestaurantsintheareabasedonauser’spreviouslydiscernedculinarypreferences. TrackingIoTDevices-Smarthomedevicesorwearables,andvehiclescaneasilybetrackedorlocatedwithgeolocation. Cybersecurity-Geolocationcanbeusedtotracknetworkintrudersorsuspicioussystemlogins;identifywhenandwherefishyonlinetransactionsaremade;anddiscovertheshadyorganizationbehindanIPaddress. RelatedTerms DirectionsAPI GIS MapAPI YoumightalsolikeGeolocationTrackingTutorialInthistutorialyou’lldiscoverhowtobuildageolocationtrackingappthatallowsuserstosharelocationsandsendmessagesinreal-time. Youwilldevelopageolocationtrackingapplicationthatallowsparticipantstolocateandinteractwitheachother,basedonPubNub'sJavascriptSDK.LearnMoreGeolocationDemoGeolocationconnectsusersaroundtheworldempoweringthemtoshareinformationandexperiencesinreal-timefromanydevice. ThisdemoshowshowyoucouldusePubNubtoshareyourlocationExperiencetheDemo ReadyToGetStarted? ContactSales
延伸文章資訊
- 1Geolocation API - W3C
The Geolocation API defines a high-level interface to location information associated only with t...
- 2What is a Geolocation API and how is it used? - PubNub
A Geolocation API is a communication interface between a client device or application (client-sid...
- 3ipstack - Free IP Geolocation API
Locate website visitors for free using ipstack - a free, real-time IP address to location JSON AP...
- 4[30apis] Day 2 : Google Map Geolocation API - iT 邦幫忙
關於Geolocation 在實作之前,我大致上知道Google Map 有個定位的API (廢話)但我一直以為它叫做location API。 所以在這邊對Location 跟Geolo...
- 5HTML Geolocation API - W3Schools
The HTML Geolocation API is used to get the geographical position of a user. ... Note: Geolocatio...