Solved

Blank MAP using googlemapapi.class_2_5.php

Posted on 2011-02-17
4
106 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
Comment Utility
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
Comment Utility
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)
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 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

10 Experts available now in Live!

Get 1:1 Help Now