Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stack overflow error

Tags:

javascript

php

i just got my first ever stack overflow when I ran this script:

var hlat = 0.00;
var hlong = 0.00;
var mapdiv = document.getElementById('map');
var map_url = base_url + 'ajax/getPropMap';
var id_url = base_url + 'hotels/gethotel_id';
var id=0;
var map = null;
// apply gmaps to product map div

$(function(){
    $.get(id_url, {id: segment}, getMapDetails);
});

function getMapDetails(data){
    $.getJSON(map_url, {id:data}, addToProdMap);
}

function getMapDetails(data){
    addProdMap(data);
}

function addProdMap(data){
    hlat = data.latitude;
    hlong = data.longitude;

    map = new google.maps.Map(mapdiv, {
            center : new google.maps.LatLng(hlat, hlong),
            zoom : 13,
            mapTypeId : 'hybrid'
    });

    var coords = new google.maps.LatLng(hlat, hlong);
    var marker = new google.maps.Marker({
        clickable : true,
        map: map,
        icon : 'http://labs.google.com/ridefinder/images/mm_20_red.png',
        position : coords
    })
}

How do I deal with this? Firefox closes and IE displays the stack overflow error

like image 342
yretuta Avatar asked May 16 '26 11:05

yretuta


1 Answers

You have two functions of the same name: getMapDetails

like image 66
Josh Stodola Avatar answered May 18 '26 23:05

Josh Stodola