-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples): Added a new example: layers-imageoverlay-example.html
- Loading branch information
1 parent
6134220
commit ebfd4b6
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="demoapp"> | ||
<head> | ||
<script src="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.js"></script> | ||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script> | ||
<script src="../dist/angular-leaflet-directive.js"></script> | ||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.css" /> | ||
<script> | ||
var app = angular.module("demoapp", ["leaflet-directive"]); | ||
app.controller("DemoController", [ "$scope", "$log", "leafletData", "leafletBoundsHelpers", function($scope, $log, leafletData, leafletBoundsHelpers) { | ||
var maxBounds = leafletBoundsHelpers.createBoundsFromArray([[-540, -960], [540, 960]]); | ||
angular.extend($scope, { | ||
defaults: { | ||
scrollWheelZoom: false, | ||
crs: 'Simple', | ||
maxZoom: 2 | ||
}, | ||
center: { | ||
lat: 0, | ||
lng: 0, | ||
zoom: 0 | ||
}, | ||
maxBounds: maxBounds, | ||
layers: { | ||
baselayers: { | ||
sanfrancisco: { | ||
name: 'Andes', | ||
type: 'imageOverlay', | ||
url: 'img/andes.jpg', | ||
bounds: [[-540, -960], [540, 960]], | ||
layerParams: { | ||
noWrap: true, | ||
attribution: 'Creative Commons image found <a href="http://www.flickr.com/photos/c32/8025422440/">here</a>' | ||
} | ||
} | ||
}, | ||
} | ||
}); | ||
}]); | ||
</script> | ||
</head> | ||
<body ng-controller="DemoController"> | ||
<h1>Layer with image overlay and maxBounds</h1> | ||
<leaflet center="center" defaults="defaults" layers="layers" maxBounds="maxBounds" height="480px" width="854px"></leaflet> | ||
</body> | ||
</html> |