On Feb 9, 5:26 am, Steve Shacklock <steve.shackl...@gmail.com> wrote:
> I'm trying to get a list of properties (that are brought in from an XML
> file) to be displayed on a map. I've had a search through and nothing has
> really helped. The problem I'm having is its going through the loop and
> just returning the last result which is plotted on the map but the other 9
> are omitted. Can anyone help me?

Does this help?

http://www.geocodezip.com/v3_MW_example_map3.html

(translated from Mike Williams' v2 tutorial)

  -- Larry

>
> <ol class="plist">
>  <?php foreach($xml_search as $property) {
> if(isset($property->id)) {
> ?>
>  <li class="plist1">
>         <a href="particulars.php?propertyID=<?php echo $property->id
> ?>"><?php echo $property->address->street ?>, <?php echo
> $property->address->town ?></a>
>          -
>
> <?php if($property->status == "Available"){ ?>
> <span class="available"><?php echo $property->status ?></span>
> <?php } ?>
>
> <?php if($property->status != "Let Subject to Contract"){ ?>
> <?php if($property->status != "Available"){ ?>
> <span class="notAvailable"><?php echo $property->status ?></span>
> <?php } ?>
> <?php } ?>
>
> <?php if($property->status == "Let Subject to Contract"){ ?>
> <span class="notAvailable">Let STC</span>
> <?php } ?>
> <br />
>         <strong>&pound;<?php echo number_format($property->price); ?> <?php
> if ($query=="false") { ?> PCM<?php } ?></strong>, <?php echo
> $property->bedrooms ?> Bed <?php echo $property->type ?>
>     </li>
>     <script type="text/javascript">
>
> var myLatlng = new google.maps.LatLng(<?php echo
> $property->address->latitude ?>,<?php echo $property->address->longitude
> ?>);
> var myOptions = {
>   zoom: 10,
>   center: new google.maps.LatLng(<?php echo $property->address->latitude;
> ?>, <?php echo $property->address->longitude; ?>),
>   mapTypeId: google.maps.MapTypeId.ROADMAP}
>
>  var marker = new google.maps.Marker({
> position: myLatlng,
> title:"<?php echo $property->address->advertising ?>",
> clickable: true,
> icon: 'images/mapicon.png'});
>
> var map = new google.maps.Map(document.getElementById("map_canvas_1"),
>     myOptions);
>
> marker.setMap(map);
>     </script>
> <?php } } //end foreach ?>
>
> </ol>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to