Jump to content

mbpowner

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by mbpowner

  1. By means of further experiment, I found that the api key does not matter. i tried entering the values of the coordinates directly for google maps to display. it works then.

     

    however, it just seems to be an issue when using the objects UserCoords.lat and UserCoords.lng in the google.maps.latlng(UserCoords.lat,UserCoords.lng) object... what data types does the latlng take and how do i transfer it?

  2. 9 hours ago, justsomeguy said:

    If you're talking about openweathermap.org, my browser's console tells me it's because it's an insecure response.  That probably means the page was loaded over HTTPS but it's trying to send a request to HTTP and the browser is blocking it.

    I figured it was to do with me using the wrong API key.  i kinda tried to use an open api key out there, but that failed. that must be something to do with secureness, i suppoe. something has changed lately. but anyways it worked when i created my own api key.

     

    anyhow, still working on the google maps... they're just warnings regarding the api key, and was working fine before for sure. now i'm just not sure why it's showing a blue sky instead of land. also my location seems to be showing zagreb, when i'm actually in england. i think this is due to the inaccuracy of the api. i tried using the coordinates and they showed the right place with google... so the coordinates are right... but the sky is, for some reason, displayed on the map. whereas on the google maps website these coordinates display my universtiy

  3. Ahh I managed to see the issue was that, for some reason, you need to have a UserCoords object in order to be visible the latitude & longitude globally instead of setting long and lat variables, the variables will be undefined but using an object it works for some odd reason... 

    Anyhow, managed to resolve hte null llocation issue. Other issue is the map won't load. If you click on the settings on the javascript you can see that this is my script src that i have used:

    https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false

     

    not sure why this isn't working... it used to work

    i'm also not sure why my JSON data isn't working ?

  4. firstly i am getting this error 

    "jQuery.Deferred exception: Can't find variable: google" "https://s.codepen.io/boomerang/iFrameKey-568d6cd1-874a-d6dd-bd79-55f4353f18e0/index.html?editors=1111:239:24
  5. Yh whoops, that's what I meant LOL. My bad. Just bcuz I code in java normally so it's easy to get carried away with the language and forget the syntax for the specific language.  And that for loop was written in a bit of a rush. My apologies

     

    also just realized. There should be no int in the parameter of the function :P

  6. Values arent being returned unless n is less than 2. Also, I'm not sure I think this is the best way to approach it:
     

    Quote

     

    function isPrime(int n){

            if(n<2){

                   return false;

               }   else if(n==2){

                       return true;

             }  

       else if(n%2==0){

                         return false;

                     }else{

                         for(int num=3; num+=2; num<n){

                               if(n%num==0){

                                      return true;

                         }

                 }

                  return false;

         }

    }


     

    This is because is a number is divisible by any even number, it's definitely divisible by 2. Just a suggestion on improving the efficiency.

×
×
  • Create New...