Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7816177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:46:19+00:00 2026-06-02T05:46:19+00:00

I’m currently use a new system for my weather website and I’m getting the

  • 0

I’m currently use a new system for my weather website and I’m getting the following error:

Uncaught TypeError: Cannot read property '__e3_' of undefined

Xe%7Bmain,places,weather%7D.js:18
Ve%7Bmain,places,weather%7D.js:21
P.addListener%7Bmain,places,weather%7D.js:18
T.(anonymous function).bindTo%7Bmain,places,weather%7D.js:27
initializejavascript.js:109
(anonymous function)javascript.js:4
f.Callbacks.ojquery.min.js:2
f.Callbacks.p.fireWithjquery.min.js:2
e.extend.readyjquery.min.js:2
c.addEventListener.B

Here’s the content in my javascript.js file which I include in my header.php (<script src="javascript.js" type="text/javascript"></script>):

$(document).ready(function() {
    initialize();
});

var elevator;
var geocoder;
var map;

function initialize() {

    // KONFIGURATION: Geocoding
    geocoder = new google.maps.Geocoder();

    // KONFIGURATION: Filnamn
    var weatherdata = 'fetch-information/fetch-weatherdata.php';

    // KONFIGURATION: Datum
    var date = new Date();
    var datetime = date.getFullYear() + '-' + 
                  (date.getMonth() < '10' ? '0' + date.getMonth() : date.getMonth()) + '-' +
                  (date.getDay() < '10' ? '0' + date.getDay() : date.getDay()) + ', ' +
                  (date.getHours() < '10' ? '0' + date.getHours() : date.getHours()) + ':' +
                  (date.getMinutes() < '10' ? '0' + date.getMinutes() : date.getMinutes()) + ':' +
                  (date.getSeconds() < '10' ? '0' + date.getSeconds() : date.getSeconds());

    // KONFIGURATION: Hämta adress
    var address = 'Karlstad, Sverige';

    // KONFIGURATION: Inställningar för kartan
    var myOptions = {
        streetViewControl: false,
        overviewMapControl: true,
        zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };


    // MOLNAKTIVITET
    var cloudLayer = new google.maps.weather.CloudLayer();
    cloudLayer.setMap(map);



    /**********************************************
    **    THE CODE BELOW IS CAUSING THE ERROR    **
    **********************************************/

    // HÖJD ÖVER / UNDER HAVSYTAN
    elevator = new google.maps.ElevationService();
    google.maps.event.addListener(map, 'click', getElevation);


    /* ** ** ** ** ** */


    // GOOGLE PLACES API
    var input = document.getElementById('googlemaps-search');
    var autocomplete = new google.maps.places.Autocomplete(input);

    autocomplete.bindTo('bounds', map);
    google.maps.event.addListener(autocomplete, 'place_changed', function() {
        var place = autocomplete.getPlace();
        alert(place.geometry.location);
    });

    /**********************************************
    **    THE CODE ABOVE IS CAUSING THE ERROR    **
    **********************************************/



    /* ** ** ** ** ** */


    // GEOCODING
    geocoder.geocode({'address' : address}, function(results, status) {

        // KONTROLL
        if(status == google.maps.GeocoderStatus.OK) {

            // KONFIGURATION: Ta bort ( och ) före och efter koordinaterna
            var old_latlong = '' + results[0].geometry.location + '';
            var new_latlong = old_latlong.substring(1, old_latlong.length - 1).replace(' ', '');

            // CENTERRING
            map.setCenter(results[0].geometry.location);

            // MARKERING: Adress
            var marker = new google.maps.Marker({
                map: map,
                position: results[0].geometry.location
            });

            // AJAX: Hämta den angivna filen
            $.ajax({
                    url: weatherdata + '?coordinates=' + new_latlong,

                    success: function() {
                                         console.log(datetime + ': Hämtningen av väderprognosen och den övriga informationen lyckades');
                                         $('.content-search').show();
                                         $('#load-weather').load(weatherdata + '?coordinates=' + new_latlong);
                                        },

                    error: function() {
                                       console.error(datetime + ': Hämtningen av väderprognosen och den övriga informationen misslyckades');
                                       $('#load-weather').hide();
                                       $('.content-search').hide();
                                       $('#message-error').show();
                                      }
                   });


        // KONTROLL
        } else {

            // FELMEDDELANDE
            alert('Kunde inte hämta data på grund av följande fel: ' + status);
        }

    });


    /* ** ** ** ** ** */


    // KARTA
    var map = new google.maps.Map(document.getElementById('weather-map'), myOptions);

}



/** ** ** ** ** ** ** ** ** ** ** ** **/



function getElevation(event) {
    var locations = [];
    var clickedLocation = event.latLng;
    locations.push(clickedLocation);

    var positionalRequest = {
        'locations': locations
    }

    elevator.getElevationForLocations(positionalRequest, function(results, status) {
        if(status == google.maps.ElevationStatus.OK) {
            var s = results[0].elevation;

            if(results[0]) {
                if(('' + parseInt(s)).charAt(0) == '-') {
                    $('#elevation').html('Cirka ' + number_format(('' + parseInt(s)).substring(1)) + ' meter under havsytan');
                } else {
                    $('#elevation').html('Cirka ' + number_format(parseInt(s)) + ' meter över havsytan');
                }
            } else {
                alert('Inget resultat hittades');
            }
        } else {
            alert('Det gick inte att hitta höjdskillnaden på grund av följande: ' + status);
        }
    });
}

The problem is that the system is quite the same as in my previous system and I have the same “code structure” on both of them and still I’m getting this error message on the new system. I don’t know why I’m getting it so I’m asking you know: how can I fix my problem?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:46:20+00:00Added an answer on June 2, 2026 at 5:46 am

    When I moved the map definition to a point before the marked buggy code, it worked. I added the var map = new google.map.Map to right after the map options.

      var myOptions = {
         streetViewControl: false,
         overviewMapControl: true,
        zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    
    var map = new google.maps.Map(document.getElementById('weather-map'), myOptions);
    
    // MOLNAKTIVITET
    var cloudLayer = new google.maps.weather.CloudLayer();
    cloudLayer.setMap(map);
    
    
    
    /**********************************************
    **    THE CODE BELOW IS CAUSING THE ERROR    **
    **********************************************/
    
    // HÖJD ÖVER / UNDER HAVSYTAN
    elevator = new google.maps.ElevationService();
    google.maps.event.addListener(map, 'click', getElevation);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.