Guest User

Untitled

a guest
Aug 18th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <div id="map_container"></div>
  2. <script type="text/javascript">
  3. mm = com.modestmaps;
  4. provider = new mm.ChitikaProvider();
  5. map = new com.modestmaps.Map('map_container', provider, new com.modestmaps.Point(290,200));
  6. <?php
  7. $i = 0;
  8. foreach($venues as $id=>$data) {
  9. ?>
  10. /* New way of creating the markers. This accurate and more precise than using the old method. */
  11. var html = '<img src="images/blue-pin-<?php echo($i); ?>.png" />';
  12. var loc = new mm.Location(<?php echo($data['lat']); ?>,<?php echo($data['long']); ?>); /* Marker location */
  13. var dimensions = new mm.Point(18, 26); /* Size of the marker/ */
  14. var f = new mm.Follower(map, loc, html, dimensions); /* Place marker on map*/
  15. <?php
  16. ++$i;
  17. }
  18. ?>
  19. /* Dont bother about this part. */
  20. map.setExtent(locations);
  21. map.setCenterZoom(map.getCenter(), 15);
  22. </script>
Add Comment
Please, Sign In to add comment