Stuck On Show the Local Weather project

My work Show the Local Weather project is stopped

step 1
I would like replace my gps coord latitude & longitude to variable
var apisrc = “” + latitude + “&” + “lon=” + longitude;

with standard function from MDN

var latitude="";
var longitude="";

function geoFindMe (){
    if (!navigator.geolocation){
        console.log("Geolocation is not supported by your browser");


    function success(position) {
         latitude  = position.coords.latitude;
         longitude = position.coords.longitude;
        console.log('Latitude is ' + latitude + 'Longitude is ' + longitude )

     function error() {
        console.log("Unable to retrieve your location")

    navigator.geolocation.getCurrentPosition(success, error)


// does not work properly :(
console.log('latitude is '+latitude+'longitude is '+ longitude)

But geoFindMe() does not work properly.

Help me please.




at this line

console.log(“Geolocation is not supported by your browser”);

I’ve edited your post for readability. When you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


I found workaround . Almost done