Geocoder: No map available!

Re: [RapidWeb] Geocoder: No map available!

By Jason - January 2, 2012

Hi,

The message "No Map Available" is being displayed because there is no value in the latitude field of that record. This usually happens when a section has not yet been geocoded. Go through the plugin screen to geocode your hotels section and then try loading the page again.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Geocoder: No map available!

By (Deleted User) - January 2, 2012 - edited: January 2, 2012

[font "Calibri"]Thanks for your quick reply.[/#000000]

[font "Calibri"]Both fields are populated (latitude and longitude). This section (hotels) has only 3 listings now. It is still in testing mode before we change over the entire site. The first thing I did was run the plugin “Geocode Talbes” for the new Hotels section. Yet still, I get the No map available message.[/#000000]

[font "Calibri"]I added these two fields to the page so that you can see that the fields are populated even on the published page:[/#000000]

latitude: <?php echo $hotelsRecord['latitude'] ?><br/>

longitude: <?php echo $hotelsRecord['longitude'] ?><br/>

This is the page:

[url "http://www.koshertravelinfo.com/kosher-hotels/kosher-hotel.php?3"][font "Calibri"]http://www.koshertravelinfo.com/kosher-hotels/kosher-hotel.php?3[/#0000ff][/url]

[font "Calibri"]I do see in the source code for the published page that there is no information for latitude and longitude in the script:[/#000000]

[/#000000]function initialize() {[/#000000]

[/#000000]var latitude = 0;[/#000000]

[/#000000]var longitude = 0;[/#000000]

[/#000000]

For some reason it does not get the info…[/#000000]

Re: [RapidWeb] Geocoder: No map available!

By Jason - January 2, 2012

Hi,

It looks like the issue is that you use the variable $hotelRecord to store your individual hotel record, but you use the variable $record when dealing with the geocoder code.

Try replacing $record with $hotelRecord in your geocoder code. That should take care of the problem.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Geocoder: No map available!

By (Deleted User) - January 2, 2012 - edited: January 2, 2012

[font "Calibri"]Still does not work… Please see my post before regarding that the latitude does show up on the page. I had edited my post right when you replied.[/#000000]

[font "Calibri"]I changed $record to $hotelsRecord as instructed and still the Google map does not load.[/#000000]

Re: [RapidWeb] Geocoder: No map available!

By Jason - January 2, 2012

Hi,

Could you please attach the kosher-hotel.php so I can take a closer look at your code?

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Geocoder: No map available!

By (Deleted User) - January 2, 2012

Here it is.

Thank you in advance for all your help!
Attachments:

kosher-hotel.php 10K

Re: [RapidWeb] Geocoder: No map available!

By Jason - January 2, 2012

Hi,

You have an extra "$" in front of your variables.

Try changing this:

<?php if (@$$hotelsRecord['latitude']): ?>
<div id="map_canvas" style="width: 299px; height: 299px; float: left; margin: 0px 15px;"></div>
<?php endif ?>

<?php if (!@$$hotelsRecord['latitude']): ?>
<div style="width: 299px; height: 299px; float: left; margin: 0px 15px; border: 1px solid #000;">
<div style="text-align: center; padding-top: 135px">
No map available!
</div>
</div>
<?php endif ?>


to this:

<?php if (@$hotelsRecord['latitude']): ?>
<div id="map_canvas" style="width: 299px; height: 299px; float: left; margin: 0px 15px;"></div>
<?php endif ?>

<?php if (!@$hotelsRecord['latitude']): ?>
<div style="width: 299px; height: 299px; float: left; margin: 0px 15px; border: 1px solid #000;">
<div style="text-align: center; padding-top: 135px">
No map available!
</div>
</div>
<?php endif ?>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Geocoder: No map available!

By (Deleted User) - January 2, 2012

[font "Calibri"]I fixed this problem. Yet no map shows up. Only difference now is that nothing shows up where the map should be. Not even the message “No map available!”.[/#000000]

[font "Calibri"]It is evident from the source code of the published page that at least now the page does get the latitude:[/#000000]

[/#000000]<script [/#000000]type="text/javascript" [/#000000]src="http://maps.google.com/maps/api/js?sensor=false"></script>

[/#000000]<script [/#000000]type="text/javascript">

[/#000000]function initialize() {[/#000000]

[/#000000]var latitude = 41.9044114;[/#000000]

[/#000000]var longitude = -72.6348236[/#000000]

Re: [RapidWeb] Geocoder: No map available!

By Jason - January 3, 2012

Hi,

Please fill out a [url http://www.interactivetools.com/support]2nd Level Support Request[/url] and I will take a closer look at the page for you.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/