here is the javascript when it works correctly…
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
jQuery('#yw0').yiiListView({'ajaxUpdate':['yw0'],'ajaxVar':'ajax','pagerClass':'pager','loadingClass':'list-view-loading','sorterClass':'sorter'});
});
window.onload=function() {
// Call this function when the page has been loaded
function egmap_1_init()
{
var mapOptions = {center:new google.maps.LatLng(38.6130569, -90.32487375),
zoom:10.,
mapTypeId:google.maps.MapTypeId.ROADMAP};
egmap_0 = new google.maps.Map(document.getElementById("egmap_1"), mapOptions);
info_window0 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/benzelLogoBig.gif\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $200,000s<br/><a href=\"#1\">More Information</a></div>"});
var marker0 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.396071, -90.388323)});
google.maps.event.addListener(marker0, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window0; info_window0.open(egmap_0,marker0);});
info_window1 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/bradfordLogoBig.gif\" alt=\"\" /><br/>St. Charles County, MO<br/>From the $290,000s<br/><a href=\"#2\">More Information</a></div>"});
var marker1 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.7715559, -90.6770389)});
google.maps.event.addListener(marker1, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window1; info_window1.open(egmap_0,marker1);});
info_window2 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/buderLogoBig.gif\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $160,000s<br/><a href=\"#3\">More Information</a></div>"});
var marker2 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.623143, -90.23015)});
google.maps.event.addListener(marker2, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window2; info_window2.open(egmap_0,marker2);});
info_window3 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/waldenPondLogoBig.png\" alt=\"\" /><br/>St. Charles County, MO<br/>From the $180,000s<br/><a href=\"#4\">More Information</a></div>"});
var marker3 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.814131, -90.722853)});
google.maps.event.addListener(marker3, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window3; info_window3.open(egmap_0,marker3);});
info_window4 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/theodoreridgeLogoBig.gif\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $210,000s<br/><a href=\"#5\">More Information</a></div>"});
var marker4 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.420086, -90.397212)});
google.maps.event.addListener(marker4, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window4; info_window4.open(egmap_0,marker4);});
info_window5 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/westendLogoBig.png\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $180,000s<br/><a href=\"#10\">More Information</a></div>"});
var marker5 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.655657, -90.286292)});
google.maps.event.addListener(marker5, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window5; info_window5.open(egmap_0,marker5);});
info_window6 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/RichardsonGlenLogoBig.jpg\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $220,000s<br/><a href=\"#12\">More Information</a></div>"});
var marker6 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.4226143, -90.4002788)});
google.maps.event.addListener(marker6, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window6; info_window6.open(egmap_0,marker6);});
info_window7 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/wellstonHeightsLogo.png\" alt=\"\" /><br/>St. Louis County, MO<br/>From the $110,000s<br/><a href=\"#13\">More Information</a></div>"});
var marker7 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.672282, -90.2896899)});
google.maps.event.addListener(marker7, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window7; info_window7.open(egmap_0,marker7);});
info_window8 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/terryParkPlaceLogo.png\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $200,000s<br/><a href=\"#14\">More Information</a></div>"});
var marker8 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.685446, -90.437446)});
google.maps.event.addListener(marker8, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window8; info_window8.open(egmap_0,marker8);});
info_window9 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/CorisandeLogoBig.png\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $220,000s<br/><a href=\"#17\">More Information</a></div>"});
var marker9 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.4907539, -90.44192)});
google.maps.event.addListener(marker9, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window9; info_window9.open(egmap_0,marker9);});
info_window10 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/AP-MH-Logo.png\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $200,000s<br/><a href=\"#15\">More Information</a></div>"});
var marker10 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.609274, -90.222576)});
google.maps.event.addListener(marker10, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window10; info_window10.open(egmap_0,marker10);});
info_window11 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/NewTownlogoWEBcommunities.png\" alt=\"\" /><br/>St. Charles County, MO<br/>From the $260,000s<br/><a href=\"#18\">More Information</a></div>"});
var marker11 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.8300428, -90.5184231)});
google.maps.event.addListener(marker11, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window11; info_window11.open(egmap_0,marker11);});
info_window12 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/terryParkPlaceLogo.png\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $260,000s<br/><a href=\"#22\">More Information</a></div>"});
var marker12 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.582419, -90.271811)});
google.maps.event.addListener(marker12, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window12; info_window12.open(egmap_0,marker12);});
info_window13 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/boulevardHeightsweblogo.png\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $210,000s<br/><a href=\"#19\">More Information</a></div>"});
var marker13 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.5607579, -90.2711606)});
google.maps.event.addListener(marker13, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window13; info_window13.open(egmap_0,marker13);});
info_window14 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/Indian-Springs-Logo.png\" alt=\"\" /><br/>St. Clair County, IL<br/>From the $0s<br/><a href=\"#20\">More Information</a></div>"});
var marker14 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.5577459, -89.9268945)});
google.maps.event.addListener(marker14, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window14; info_window14.open(egmap_0,marker14);});
}
egmap_1_init();
};
/*]]>*/
</script>
Here is the javascript for when it’s placed incorrectly…
<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {
jQuery('#yw0').yiiListView({'ajaxUpdate':['yw0'],'ajaxVar':'ajax','pagerClass':'pager','loadingClass':'list-view-loading','sorterClass':'sorter'});
});
window.onload=function() {
// Call this function when the page has been loaded
function egmap_1_init()
{
var mapOptions = {center:new google.maps.LatLng(19.4150214, -45.3614265),
zoom:3.,
mapTypeId:google.maps.MapTypeId.ROADMAP};
egmap_0 = new google.maps.Map(document.getElementById("egmap_1"), mapOptions);
info_window0 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/benzelLogoBig.gif\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $200,000s<br/><a href=\"#1\">More Information</a></div>"});
var marker0 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.396071, -90.388323)});
google.maps.event.addListener(marker0, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window0; info_window0.open(egmap_0,marker0);});
info_window1 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/bradfordLogoBig.gif\" alt=\"\" /><br/>St. Charles County, MO<br/>From the $290,000s<br/><a href=\"#2\">More Information</a></div>"});
var marker1 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.7715559, -90.6770389)});
google.maps.event.addListener(marker1, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window1; info_window1.open(egmap_0,marker1);});
info_window2 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/buderLogoBig.gif\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $160,000s<br/><a href=\"#3\">More Information</a></div>"});
var marker2 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.623143, -90.23015)});
google.maps.event.addListener(marker2, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window2; info_window2.open(egmap_0,marker2);});
info_window3 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/waldenPondLogoBig.png\" alt=\"\" /><br/>St. Charles County, MO<br/>From the $180,000s<br/><a href=\"#4\">More Information</a></div>"});
var marker3 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.814131, -90.722853)});
google.maps.event.addListener(marker3, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window3; info_window3.open(egmap_0,marker3);});
info_window4 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/theodoreridgeLogoBig.gif\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $210,000s<br/><a href=\"#5\">More Information</a></div>"});
var marker4 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.420086, -90.397212)});
google.maps.event.addListener(marker4, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window4; info_window4.open(egmap_0,marker4);});
info_window5 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/westendLogoBig.png\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $180,000s<br/><a href=\"#10\">More Information</a></div>"});
var marker5 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.655657, -90.286292)});
google.maps.event.addListener(marker5, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window5; info_window5.open(egmap_0,marker5);});
info_window6 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/RichardsonGlenLogoBig.jpg\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $220,000s<br/><a href=\"#12\">More Information</a></div>"});
var marker6 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.4226143, -90.4002788)});
google.maps.event.addListener(marker6, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window6; info_window6.open(egmap_0,marker6);});
info_window7 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/wellstonHeightsLogo.png\" alt=\"\" /><br/>St. Louis County, MO<br/>From the $110,000s<br/><a href=\"#13\">More Information</a></div>"});
var marker7 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.672282, -90.2896899)});
google.maps.event.addListener(marker7, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window7; info_window7.open(egmap_0,marker7);});
info_window8 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/terryParkPlaceLogo.png\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $200,000s<br/><a href=\"#14\">More Information</a></div>"});
var marker8 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.685446, -90.437446)});
google.maps.event.addListener(marker8, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window8; info_window8.open(egmap_0,marker8);});
info_window9 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/CorisandeLogoBig.png\" alt=\"\" /><br/>Jefferson County, MO<br/>From the $220,000s<br/><a href=\"#17\">More Information</a></div>"});
var marker9 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.4907539, -90.44192)});
google.maps.event.addListener(marker9, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window9; info_window9.open(egmap_0,marker9);});
info_window10 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/AP-MH-Logo.png\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $200,000s<br/><a href=\"#15\">More Information</a></div>"});
var marker10 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.609274, -90.222576)});
google.maps.event.addListener(marker10, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window10; info_window10.open(egmap_0,marker10);});
info_window11 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/NewTownlogoWEBcommunities.png\" alt=\"\" /><br/>St. Charles County, MO<br/>From the $260,000s<br/><a href=\"#18\">More Information</a></div>"});
var marker11 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.8300428, -90.5184231)});
google.maps.event.addListener(marker11, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window11; info_window11.open(egmap_0,marker11);});
info_window12 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/terryParkPlaceLogo.png\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $260,000s<br/><a href=\"#22\">More Information</a></div>"});
var marker12 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(38.582419, -90.271811)});
google.maps.event.addListener(marker12, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window12; info_window12.open(egmap_0,marker12);});
info_window13 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/boulevardHeightsweblogo.png\" alt=\"\" /><br/>St. Louis City, MO<br/>From the $210,000s<br/><a href=\"#19\">More Information</a></div>"});
var marker13 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(0, 0)});
google.maps.event.addListener(marker13, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window13; info_window13.open(egmap_0,marker13);});
info_window14 = new google.maps.InfoWindow({content:"<div style=\'text-align:center; padding:5px\'><img width=\"150px\" src=\"/BuilderApp/public_html/images/Indian-Springs-Logo.png\" alt=\"\" /><br/>St. Clair County, IL<br/>From the $0s<br/><a href=\"#20\">More Information</a></div>"});
var marker14 = new google.maps.Marker({map:egmap_0,
position:new google.maps.LatLng(0, 0)});
google.maps.event.addListener(marker14, "click", function() {if (egmap_0_info_window) egmap_0_info_window.close(); egmap_0_info_window = info_window14; info_window14.open(egmap_0,marker14);});
}
egmap_1_init();
};
/*]]>*/
</script>
The marker in question is the last marker (marker14). It seems the LatLng is being set to (0, 0) for some reason. I also noticed that it isn’t being set for marker13 either.
I pull the addresses out of the database with the following code…
<?php
Yii::import('application.extensions.gmaps.*');
$gMap = new EGMap();
// Not needed but you can do it for more control
// over IDs
// $gMap->setContainerId('map2');
// changing proportions
$gMap->setWidth(640);
$gMap->setHeight(470);
foreach($communities as $community)
{
$popUp = '<div style=\'text-align:center; padding:5px\'>'
.CHtml::image(Yii::getPathOfAlias('images').CHtml::encode($community->logoURL),'',array('width'=>'150px')).
'<br/>'.$community->location->description.
'<br/>From the '.$community->fromPrice().'s'.
'<br/>'.CHtml::link("More Information", "#".$community->id, array()).
'</div>';
// Create GMapInfoWindow
$info_window = new EGMapInfoWindow($popUp);
// Create geocoded address
$geocoded_address = new EGMapGeocodedAddress($community->address);
$geocoded_address->geocode($gMap->getGMapClient());
$marker = new EGMapMarker($geocoded_address->getLat(), $geocoded_address->getLng());
$marker->addHtmlInfoWindow($info_window);
// Add marker on geocoded address
$gMap->addMarker($marker);
}
$gMap->centerAndZoomOnMarkers();
$gMap->renderMap();
?>
Thanks for your help.