Solved

Blank MAP using googlemapapi.class_2_5.php

Posted on 2011-02-17
4
120 Views
Last Modified: 2013-11-30
The code bellow work just fine when used alone (called directed in the URL) but inside the rest of the code nothing appears on screen!
<head>
        <style type="text/css">v\:* {behavior:url(#default#VML);}</style>
</head>

<body onload="onLoad()"> 
       
        <?php 
        require($_SERVER['DOCUMENT_ROOT'] . '/mod/mapa/googlemapapi.class_2_5.php');
        $map = new GoogleMapAPI('map');
        $map->setAPIKey('ABQIAAAAH1Dik6l98ZwI-9bNv2jkhRRycExbv9_dgh8OHqcKgbMA7oaqhRTY5gjAiydpSiPhRxNLlNvsWX_hDw');
        $map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');
        $map->addMarkerByAddress('826 P St Lincoln NE 68502','Old Chicago','<b>Old Chicago</b>');
        $map->printHeaderJS();
        $map->printMapJS(); 
        $map->printMap();
        ?>

Open in new window

div-map.jpg
map-ok.jpg
0
Comment
Question by:rapchan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 250 total points
ID: 34922756
Sounds like there is a javascript error at runtime that is short-circuiting some of your javscript code.  Any javascript error aborts execution of the script, with few indications.  Have you turned on Javascript error reporting in your browser preferences?

To debug this, you could place some temporary alert() statements in your code to see if it is even getting to your map code.  If not, move the alert() statements earlier and earlier in the javascript to narrow in on the problem.
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 34925283
You might want to consider using the Google Static maps.  Have a look at this article - you can copy the code and try it.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_3350-Using-the-Google-Maps-API-in-PHP.html

An example of the class in action is available here:
http://www.landonbaseball.com/site_visitors.php
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 39686705
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question