-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #632 from twpayne/mobile-full-screen-example
Mobile full screen example
- Loading branch information
Showing
4 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
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,27 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="chrome=1"> | ||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width"> | ||
<title>Mobile full screen example</title> | ||
<style type="text/css"> | ||
html, body, .map { | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="map" class="map"></div> | ||
<script src="loader.js?id=mobile-full-screen" type="text/javascript"></script> | ||
|
||
<div style="display: none;"> | ||
<div id="title">Mobile full screen example</div> | ||
<div id="shortdesc">Example of a full screen map.</div> | ||
<div id="tags">fullscreen, bing, geolocation, mobile</div> | ||
</div> | ||
</body> | ||
</html> |
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,35 @@ | ||
goog.require('ol.Geolocation'); | ||
goog.require('ol.Map'); | ||
goog.require('ol.RendererHints'); | ||
goog.require('ol.View2D'); | ||
goog.require('ol.layer.TileLayer'); | ||
goog.require('ol.source.BingMaps'); | ||
|
||
|
||
var view = new ol.View2D({ | ||
center: [0, 0], | ||
zoom: 2 | ||
}); | ||
|
||
var map = new ol.Map({ | ||
layers: [ | ||
new ol.layer.TileLayer({ | ||
source: new ol.source.BingMaps({ | ||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q', | ||
style: 'Road' | ||
}) | ||
}) | ||
], | ||
renderers: ol.RendererHints.createFromQueryData(), | ||
target: 'map', | ||
view: view | ||
}); | ||
|
||
var geolocation = new ol.Geolocation({ | ||
tracking: true | ||
}); | ||
geolocation.bindTo('projection', view); | ||
geolocation.on('position_changed', function() { | ||
view.setCenter(geolocation.getPosition()); | ||
view.setResolution(2.388657133911758); | ||
}); |
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
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