Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. var winh = $(window).height();
  2. var winw = $(window).width();
  3. var maph = $('#map').height();
  4. var mapw = $('#map').width();
  5. var offset = $('#map').offset();
  6. var centerX = offset.left + mapw / 2;
  7. var centerY = offset.top + maph / 2;
  8. var changem = false;
  9. var cbut = $('#building');
  10. var southWest = new L.LatLng(winh, 0);
  11. var northEast = new L.LatLng(0, winw);
  12. var bounds = L.latLngBounds(southWest, northEast);
  13.  
  14. var map = L.map('map', {
  15. maxBounds: bounds,
  16. maxZoom: 2,
  17. minZoom: 0,
  18. crs: L.CRS.Simple
  19. }).setView([winh, winw], 0);
  20. // .setView([winh, winw], 0)
  21. map.setMaxBounds(bounds);
  22.  
  23. // map.panTo(new L.LatLng(centerY,centerX));
  24.  
  25. // ----------------------------------
  26. // Load the images for the map
  27. // ----------------------------------
  28. var imageUrl = 'http://rigailoveyou.exflairdigital.com/public/img/houses.png'
  29. var imageUrl2 = 'http://rigailoveyou.exflairdigital.com/public/img/road.png'
  30. var imageBounds = [[winh,0], [0,winw]];
  31.  
  32. var map1 = L.imageOverlay(imageUrl, bounds,'Riga I Love You').addTo(map);
  33. var map2 = L.imageOverlay(imageUrl2, bounds).addTo(map);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement