pop up in single map?

By rez - March 28, 2011

using the code from the multi example doesnt seem to be enough to make a pop-up in the single map. Is there something from the the top of the page i need? I just copied:

<!-- popup window -->
<div id="marker_details" style="display: none;">
<?php foreach ($addressRecords as $record): ?>
<div id="marker_infowindow_<?php echo $record['num']; ?>">
<?php if($record['coming_soon']):?><strong>Coming Soon!</strong><br /><?php endif?>
<?php echo htmlspecialchars( @$record['address']); ?><br />
<?php if($record['city']):?><?php echo htmlspecialchars($record['city']); ?><?php endif?><?php if($record['state']):?>,&nbsp;<?php echo $record['state:label']; ?><?php endif?><?php if($record['zipcode']):?>&nbsp;<?php echo htmlspecialchars($record['zipcode']); ?><?php endif?><br/><?php if($record['phone']):?><strong>Phone&nbsp;</strong><?php echo htmlspecialchars($record['phone']); ?><?php endif?>


</div>
<?php endforeach ?>

Re: [rez] pop up in single map?

By robin - March 29, 2011

Hi Rez,

Thanks for the question. Probably the easiest thing to do if you want a popup is to use the multi example and change the viewer code at the top so only one result is displayed. Something like this:
// get records
list($myRecords, $myMetaData) = getRecords(array(
'tableName' => $GLOBALS['GEOCODER_SAMPLE_TABLENAME'],
'where' => whereRecordNumberInUrl(1),
'limit' => 1
));


Hope that helps,
Robin
Robin
Programmer
interactivetools.com