Click here to Skip to main content
15,923,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I get two error when using google map:

Warning: you have included the Google Maps API multiple times on this page. This may cause unexpected errors.
a is null (main.js)

i don't know if there is any connection between the two, but the final result is that my page cannot load the map.

here is my head tag:
XML
<script type="text/javascript" src="../s/Jquery/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="../s/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="../s/index.js"></script>
<script type="text/javascript" src="../s/Jquery/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../s/Jquery/ui/jquery.ui.widget.js"></script>

<script type="text/javascript" src="../s/Jquery/ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="../s/Jquery/ui/jquery.ui.autocomplete.js"></script>
<script src="../dd/markerclusterer_compiled.js" type="text/javascript"></script><script src="../dd/dealers_js.js" type="text/javascript"></script><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>


here is the function which i call the google map:
JavaScript
function set_google_map(set_region)
{

        var zoom;
        var center;
        switch (set_region) {
            case "usa":
                zoom = 3;
                center = new google.maps.LatLng(37.09, -95.71);
                break;
            case "europe":
                zoom = 3;
                center = new google.maps.LatLng(48.58, 7.71);
                break;
            case "east":
                zoom = 3;
                center = new google.maps.LatLng(31, 121);
                break;
            default:
                zoom = 1;
                center = new google.maps.LatLng(35, 5);
        }
        // Creating the map
        map = new google.maps.Map(document.getElementById('map'), options);
        google.maps.event.addListener(map, 'click', function(){
            clean_icons();
            if (infowindow)
                infowindow.close();
        });
        map.setCenter(center);
        map.setZoom(zoom);


            //bounds = new google.maps.LatLngBounds();
}


these are my variables:
JavaScript
<pre lang="cs">var UseridEncr;
var super_category="ATE";
var infowindow;
var map;
var bounds;
var image="../dd/i/green.png";
var image_active="../dd/i/red.png";
var mc ;
var location_changed=true;
var current_region="usa";
var mcOptions = {gridSize:30, maxZoom: 8};
var last_marker;
var last_marker_z;
var DealersData ;
var markers=[];
var markers_selected=[];
claster_markers=[];
var current_view=0;
myData={};
var selected_items=[];
var total_selected=0;



these are my options:
JavaScript
var options = {
      disableDefaultUI: true,
      zoomControl: true,
      zoomControlOptions: {     style: google.maps.ZoomControlStyle.SMALL   },
      navigationControl: false,
      scaleControl: true,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };


thanks for your answer!




Edit: Bring Text from OP-Answer


i include it via coldfusion in this way:
dealer_directory.cfm:
JavaScript
<Cfset description="Used Test &amp; Measurement ,Laboratory and SEMI Dealer Directory">
<cfset script='<script src="../dd/markerclusterer_compiled.js" type="text/javascript"></script><script src="../dd/dealers_js.js" type="text/javascript"></script><script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>'>
<cfset css='<link rel="stylesheet" type="text/css" href="../dd/i/dealer_directory.css" />'>
<cfinclude template="../including/header.cfm">

head.cfm:
JavaScript
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<cfoutput>
<META NAME="ROBOTS" CONTENT="#index_follow#">
<cfif canonical_file_name NEQ "">
<link href="#canonical_file_name#" rel="canonical">
</cfif>
<base href="#Application.URL#/z/z" />
<title>#title#</title>
<meta name="description" content="#description#" />
<meta name="keywords" content="#keywords#" /></cfoutput>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../c/global.css" />
<link rel="stylesheet" type="text/css" href="../c/header.css" />
<link rel="stylesheet" href="../s/Jquery/themes/jquery.ui.autocomplete.css"/>
<link rel="stylesheet" href="../s/Jquery/themes/jquery.ui.theme.css"/>
<cfoutput>#css#</cfoutput>
<script type="text/javascript" src="../s/Jquery/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="../s/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="../s/index.js"></script>
<script type="text/javascript" src="../s/Jquery/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../s/Jquery/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../s/Jquery/ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="../s/Jquery/ui/jquery.ui.autocomplete.js"></script>
<cfoutput>#script#</cfoutput>
Posted
Updated 19-Mar-12 11:00am
v2
Comments
ZurdoDev 19-Mar-12 8:11am    
Assuming the error is not a bug on google's part then you must be loading it more than once. Are you using a master page or loading scripts through C# or in a user control? It must be somewhere.
Nelek 19-Mar-12 17:01pm    
dtpozner if you are going to give additional information to your question, because someone asked you something, please use the "improve question" link you have at the bottom avoiding to give answers that are not answers.

Edit: Additional information added to the question
 
Share this answer
 
v2
i solved the problem. something in my colfusion code was incorrect.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900