Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example(dragndrop): update the legend #1159

Merged
merged 1 commit into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/css/example.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ body {
padding: 0 1rem;
}

.help a {
color: lightcoral;
}

@media (max-width: 600px) {
.help {
display: none;
Expand Down
16 changes: 7 additions & 9 deletions examples/drag-n-drop.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
</head>
<body>
<div id="viewerDiv">
<div class="help"><p>Drag and drop a Geojson or Gpx file onto the viewer, and see it
loaded as a ColorLayer.</p></div>
<div class="help"><p>Drag and drop a Geojson or Gpx file onto the
viewer, and see it loaded as a ColorLayer. Only files with the
projection <b>EPSG:4326</b> can be projected correctly in this
demo. More information about the plugin used <a
href="http://www.itowns-project.org/itowns/docs/#api/Plugins/DragNDrop"
target="_blank">in the documentation.</a></p></div>
</div>
<script src="js/GUI/GuiTools.js"></script>
<script src="js/DragNDrop.js"></script>
<script src="../dist/itowns.js"></script>
<script src="js/loading_screen.js"></script>
<script src="../dist/debug.js"></script>
<script type="text/javascript">
// Define initial camera position
var positionOnGlobe = { longitude: 2.351323, latitude: 48.856712,
Expand All @@ -36,7 +38,7 @@
itowns.Fetcher.json('./layers/JSONLayers/Ortho.json').then(function _(config) {
config.source = new itowns.WMTSSource(config.source);
var layer = new itowns.ColorLayer('Ortho', config);
view.addLayer(layer).then(menuGlobe.addLayerGUI.bind(menuGlobe));
view.addLayer(layer);
});

// Add two elevation layers.
Expand All @@ -52,10 +54,6 @@
DragNDrop.setView(view);
DragNDrop.register('geojson', DragNDrop.JSON, itowns.GeoJsonParser.parse, DragNDrop.COLOR);
DragNDrop.register('gpx', DragNDrop.XML, itowns.GpxParser.parse, DragNDrop.COLOR);

var menuGlobe = new GuiTools('menuDiv', view);
var d = new debug.Debug(view, menuGlobe.gui);
debug.createTileDebugUI(menuGlobe.gui, view, view.tileLayer, d);
</script>
</body>
</html>
Expand Down