Add GPX files to drag-and-drop example

This commit is contained in:
Tom Payne
2014-01-16 19:19:42 +01:00
parent 729be27662
commit ee91a99056
2 changed files with 4 additions and 2 deletions

View File

@@ -31,11 +31,11 @@
<div class="span4"> <div class="span4">
<h4 id="title">Drag-and-Drop example</h4> <h4 id="title">Drag-and-Drop example</h4>
<p id="shortdesc">Example of using the drag-and-drop interaction. Drag and drop KML files on to the map.</p> <p id="shortdesc">Example of using the drag-and-drop interaction. Drag and drop GPX or KML files on to the map.</p>
<div id="docs"> <div id="docs">
<p>See the <a href="drag-and-drop.js" target="_blank">drag-and-drop.js source</a> to see how this is done.</p> <p>See the <a href="drag-and-drop.js" target="_blank">drag-and-drop.js source</a> to see how this is done.</p>
</div> </div>
<div id="tags">drag-and-drop, kml</div> <div id="tags">drag-and-drop, gpx, kml</div>
</div> </div>
<div class="span4 offset4"> <div class="span4 offset4">
<div id="info" class="alert alert-success"> <div id="info" class="alert alert-success">

View File

@@ -1,6 +1,7 @@
goog.require('ol.Map'); goog.require('ol.Map');
goog.require('ol.RendererHint'); goog.require('ol.RendererHint');
goog.require('ol.View2D'); goog.require('ol.View2D');
goog.require('ol.format.GPX');
goog.require('ol.format.KML'); goog.require('ol.format.KML');
goog.require('ol.interaction'); goog.require('ol.interaction');
goog.require('ol.interaction.DragAndDrop'); goog.require('ol.interaction.DragAndDrop');
@@ -82,6 +83,7 @@ var map = new ol.Map({
interactions: ol.interaction.defaults().extend([ interactions: ol.interaction.defaults().extend([
new ol.interaction.DragAndDrop({ new ol.interaction.DragAndDrop({
formatConstructors: [ formatConstructors: [
ol.format.GPX,
ol.format.KML ol.format.KML
], ],
styleFunction: styleFunction styleFunction: styleFunction