Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

GoogleMapsAPI 2.5 prints a BLANK map

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
eatc7402
Smarty Rookie


Joined: 18 Feb 2008
Posts: 23

PostPosted: Fri Feb 22, 2008 2:58 am    Post subject: GoogleMapsAPI 2.5 prints a BLANK map Reply with quote

The following code all seems to work just fine
EXCEPT all I get is a BLANK GREY map image.

Can anyone tell me what I am doing wrong??

Code:
<?php
    require('GoogleMapAPI.class.php');
    $map = new GoogleMapAPI('map');
     // enter YOUR Google Map Key
    // for localhost
    $map->setAPIKey('ABQIAAAAA4K1gFTiRd0xfFgeHzQw0hT2yXp_ZAY8_ufC3CFXhHIE1NvwkxS4Rhy5yj3Tk5ZD3asAY4fsBSoF1Q');
    $map->setWidth('500px');
    $map->setHeight('500px');
    $map->enableOverviewControl() ;
    $geocode = $map->geoGetCoords('237 S 70th suite 220 Lincoln NE 68510');
        echo $geocode['lon'];
        $lon = $geocode ;
        echo "<br>" ;
        echo $geocode['lat'];
        $lat = $geocode ;
    $map->setCenterCoords($lon,$lat) ;
    $map->addMarkerByCoords($lon,$lat,'test','test');
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <?php $map->printHeaderJS(); ?>
    <?php $map->printMapJS(); ?>
    <!-- necessary for google maps polyline drawing in IE -->
    <style type="text/css">
      v\:* {
        behavior:url(#default#VML);
      }
    </style>
    </head>
    <body onload="onLoad()">
    <table border=1>
      <tr>
        <td>
          <?php $map->printMap(); ?>
        </td>
        <td>
          <?php $map->printSidebar(); ?>
        </td>
      </tr>
    </table>
    </body>
    </html>


eatc7402
Back to top
View user's profile Send private message Send e-mail
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Feb 22, 2008 3:00 pm    Post subject: Reply with quote

Any javascript errors in the browser? I'd check there first.
Back to top
View user's profile Send private message Visit poster's website
eatc7402
Smarty Rookie


Joined: 18 Feb 2008
Posts: 23

PostPosted: Fri Feb 22, 2008 4:00 pm    Post subject: Reply with quote

I found the problem. Being a somewhat map API novice I was
confusing a BLANK map erroneously for instead...
"pointing a map incorrectly to a place with NO MAP IMAGES".
I have discovered a good troubleshooting tip, and that is to
ZOOM OUT all the way, and you may discover your placemarks
are not where you thought you were placeing them. The code
that was...
Code:
$geocode = $map->geoGetCoords('237 S 70th suite 220 Lincoln NE 68510');
        echo $geocode['lon'];
        $lon = $geocode ;
        echo "<br>" ;
        echo $geocode['lat'];
        $lat = $geocode ;
    $map->addMarkerByCoords($lon,$lat,'test','test');

I now changed to this....
Code:
 $geocode = $map->geoGetCoords('237 S 70th suite 220 Lincoln NE 68510');
        echo $geocode['lon'];
        echo "<br>" ;
        echo $lon;
        echo $geocode['lat'];
$map->addMarkerByCoords($geocode['lon'],$geocode['lat'],'test','test');

And now I am passing the proper lat/lon values instead of
attempting to pass an ARRAY which will not work, and points
map to a position off the earths msp images.

eatc7402

However I am still having my same proble with the DB error
not found when trying to use the database for cacheing.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP