Solved

Blank MAP using googlemapapi.class_2_5.php

Posted on 2011-02-17
4
118 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
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 109

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Maps API and PHP 25 49
Is there a simpler dropbox system? 10 34
Read a remote csv file from a https URL 8 49
Generate PDF from MySQL using PHP 3 24
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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.

827 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