Find Jobs
Hire Freelancers

Javascript - Save Geolocation Coordinates

$10-30 USD

Completed
Posted over 5 years ago

$10-30 USD

Paid on delivery
I would like to save the coordinates in localstorage so that it shouldn't ask the users every time to allow GPS or Location and a button to clear the localstorage value so it can again ask for coordinates? Also it should work with Android & IOS Mobile View. FYI: I am using Praytimes JS to display Muslim prayer times but for each location i have to manually add latitude & longitude of that location. Below is my code: <script type="text/javascript" src="[login to view URL]"></script> <script type="text/javascript"> var x = [login to view URL]("currentlocation"); var geocoder; if ([login to view URL]) { [login to view URL](successFunction, errorFunction); } //Get the latitude and the longitude; function successFunction(position) { var lat = [login to view URL]; var lng = [login to view URL]; codeLatLng(lat, lng) } function errorFunction(){ $('#currentlocation').html("Geocoder failed"); } function initialize() { geocoder = new [login to view URL](); } function codeLatLng(lat, lng) { var latlng = new [login to view URL](lat, lng); [login to view URL]({'latLng': latlng}, function(results, status) { if (status == [login to view URL]) { [login to view URL](results) if (results[1]) { //formatted address $('#currentlocation').html(results[0].formatted_address); //find country name for (var i=0; i<results[0].[login to view URL]; i++) { for (var b=0;b<results[0].address_components[i].[login to view URL];b++) { //there are different types that might hold a city admin_area_lvl_1 usually does in come cases looking for sublocality type will be more appropriate if (results[0].address_components[i].types[b] == "administrative_area_level_2") { //this is the object you are looking for city= results[0].address_components[i]; break; } } } //city data $('#currentlocation').html(city.short_name + " " + city.long_name) } else { $('#currentlocation').html("No results found"); } } else { $('#currentlocation').html("Geocoder failed due to: " + status); } }); } </script> <p id="currentlocation"></p> <script type="text/javascript" src="[login to view URL]"></script> <script type="text/javascript"> function loadTable(position) { [login to view URL]('MWL'); var date = new Date(); // today var times = [login to view URL](date, [[login to view URL], [login to view URL]]); var list = ['Fajr', 'Sunrise', 'Dhuhr', 'Asr', 'Maghrib', 'Isha', 'Midnight']; var html = '<table id="timetable">'; html += '<tr><th colspan="2">'+ [login to view URL]()+ '</th></tr>'; for(var i in list) { html += '<tr><td>'+ list[i]+ '</td>'; html += '<td>'+ times[list[i].toLowerCase()]+ '</td></tr>'; } html += '</table>'; [login to view URL]('table').innerHTML = html; } if ([login to view URL]) { [login to view URL](loadTable); } </script>
Project ID: 17329237

About the project

5 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I am a Software Engineer having 6 years of extensive hands-on experience in Object Oriented Analysis & Design (OOAD) and Database Design and Implementation using Agile, UML, .NET Framework, C#, ASP.NET, ASP.NET MVC, T-SQL and SQL Server. Strong believer in project delivery & attaining success in challenging tasks with a passion to explore the new horizons of modern days Technologies & Architectures, Also keen to invest in continuous software process improvement using Agile software Methodologies / Modeling along with standard practices & industry proven software design patterns. + AJAX, HTML5, CSS3, JavaScript, jQuery, AngularJs, JSON + ASP.NET, C#.NET, [login to view URL], Web Forms + MVC 3,4,5 + Entity Framework (EF), LINQ, MVC, 3Tier Architecture, nTiter Architecture + Microsoft SQL Server 2008 R2, 2012, 2014, 2016 + MySql, NoSQL (MongoDb) + Web API + Web Services, Windows Services + Reports (RDLC, SSRS) + Cross browser issues handling and code optimization techniques for high traffic. + UI/UX Development Specialties: + Web Application Development + Desktop Application Development + Responsive Web Applications + eCommerce Solutions + Rich Internet Applications + UI Development + Scrum + Team Management + Software Project Management
$10 USD in 0 day
4.8 (7 reviews)
3.4
3.4

About the client

Flag of KUWAIT
salmiya, Kuwait
4.7
6
Payment method verified
Member since Aug 27, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.