Solved

Blank MAP using googlemapapi.class_2_5.php

Posted on 2011-02-17
4
111 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 108

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now