add leaflet for defining extent

This commit is contained in:
Arno Kaimbacher 2019-01-08 14:06:21 +01:00
parent ba38fc1ed1
commit d6c449c2df
12 changed files with 1425 additions and 90 deletions

View File

@ -190,7 +190,7 @@ trait DatasetExtension
continue;
} else {
// Immediately load external field if fetching mode is set to 'eager'
$this->_loadExternal($fieldname);
$this->loadExternal($fieldname);
}
} else {
// Field is not external an gets handled by simply reading
@ -217,7 +217,7 @@ trait DatasetExtension
return strtolower(preg_replace('/(?!^)[[:upper:]]/', '_\0', $fieldname));
}
protected function _loadExternal($fieldname)
protected function loadExternal($fieldname)
{
$field = $this->fields[$fieldname];

130
composer.lock generated
View File

@ -1747,16 +1747,16 @@
},
{
"name": "symfony/console",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb"
"reference": "a700b874d3692bc8342199adfb6d3b99f62cc61a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb",
"reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb",
"url": "https://api.github.com/repos/symfony/console/zipball/a700b874d3692bc8342199adfb6d3b99f62cc61a",
"reference": "a700b874d3692bc8342199adfb6d3b99f62cc61a",
"shasum": ""
},
"require": {
@ -1812,7 +1812,7 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2018-11-26T12:48:07+00:00"
"time": "2019-01-04T04:42:43+00:00"
},
{
"name": "symfony/contracts",
@ -1884,16 +1884,16 @@
},
{
"name": "symfony/css-selector",
"version": "v4.2.1",
"version": "v4.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "aa9fa526ba1b2ec087ffdfb32753803d999fcfcd"
"reference": "76dac1dbe2830213e95892c7c2ec1edd74113ea4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/aa9fa526ba1b2ec087ffdfb32753803d999fcfcd",
"reference": "aa9fa526ba1b2ec087ffdfb32753803d999fcfcd",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/76dac1dbe2830213e95892c7c2ec1edd74113ea4",
"reference": "76dac1dbe2830213e95892c7c2ec1edd74113ea4",
"shasum": ""
},
"require": {
@ -1933,20 +1933,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2018-11-11T19:52:12+00:00"
"time": "2019-01-03T09:07:35+00:00"
},
{
"name": "symfony/debug",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "a2233f555ddf55e5600f386fba7781cea1cb82d3"
"reference": "26d7f23b9bd0b93bee5583e4d6ca5cb1ab31b186"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/a2233f555ddf55e5600f386fba7781cea1cb82d3",
"reference": "a2233f555ddf55e5600f386fba7781cea1cb82d3",
"url": "https://api.github.com/repos/symfony/debug/zipball/26d7f23b9bd0b93bee5583e4d6ca5cb1ab31b186",
"reference": "26d7f23b9bd0b93bee5583e4d6ca5cb1ab31b186",
"shasum": ""
},
"require": {
@ -1989,20 +1989,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2018-11-27T12:43:10+00:00"
"time": "2019-01-01T13:45:19+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "cc35e84adbb15c26ae6868e1efbf705a917be6b5"
"reference": "d1cdd46c53c264a2bd42505bd0e8ce21423bd0e2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/cc35e84adbb15c26ae6868e1efbf705a917be6b5",
"reference": "cc35e84adbb15c26ae6868e1efbf705a917be6b5",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d1cdd46c53c264a2bd42505bd0e8ce21423bd0e2",
"reference": "d1cdd46c53c264a2bd42505bd0e8ce21423bd0e2",
"shasum": ""
},
"require": {
@ -2052,20 +2052,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2018-11-30T18:07:24+00:00"
"time": "2019-01-01T18:08:36+00:00"
},
{
"name": "symfony/finder",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "6cf2be5cbd0e87aa35c01f80ae0bf40b6798e442"
"reference": "3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/6cf2be5cbd0e87aa35c01f80ae0bf40b6798e442",
"reference": "6cf2be5cbd0e87aa35c01f80ae0bf40b6798e442",
"url": "https://api.github.com/repos/symfony/finder/zipball/3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e",
"reference": "3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e",
"shasum": ""
},
"require": {
@ -2101,20 +2101,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2018-11-11T19:48:54+00:00"
"time": "2019-01-01T13:45:19+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "ea61dd57c4399b0b2a4162e1820cd9d0783acd38"
"reference": "2b97319e68816d2120eee7f13f4b76da12e04d03"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/ea61dd57c4399b0b2a4162e1820cd9d0783acd38",
"reference": "ea61dd57c4399b0b2a4162e1820cd9d0783acd38",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/2b97319e68816d2120eee7f13f4b76da12e04d03",
"reference": "2b97319e68816d2120eee7f13f4b76da12e04d03",
"shasum": ""
},
"require": {
@ -2155,20 +2155,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2018-11-26T10:17:44+00:00"
"time": "2019-01-05T08:05:37+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "31f20eb6e00467ae85501dd98770aef17cd9aba7"
"reference": "60bd9d7444ca436e131c347d78ec039dd99a34b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/31f20eb6e00467ae85501dd98770aef17cd9aba7",
"reference": "31f20eb6e00467ae85501dd98770aef17cd9aba7",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/60bd9d7444ca436e131c347d78ec039dd99a34b4",
"reference": "60bd9d7444ca436e131c347d78ec039dd99a34b4",
"shasum": ""
},
"require": {
@ -2244,7 +2244,7 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2018-12-06T14:59:33+00:00"
"time": "2019-01-06T15:53:59+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -2424,16 +2424,16 @@
},
{
"name": "symfony/process",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "abb46b909dd6ba0b50e10d4c10ffe6ee96dd70f2"
"reference": "0d41dd7d95ed179aed6a13393b0f4f97bfa2d25c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/abb46b909dd6ba0b50e10d4c10ffe6ee96dd70f2",
"reference": "abb46b909dd6ba0b50e10d4c10ffe6ee96dd70f2",
"url": "https://api.github.com/repos/symfony/process/zipball/0d41dd7d95ed179aed6a13393b0f4f97bfa2d25c",
"reference": "0d41dd7d95ed179aed6a13393b0f4f97bfa2d25c",
"shasum": ""
},
"require": {
@ -2469,20 +2469,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2018-11-20T16:10:26+00:00"
"time": "2019-01-02T21:24:08+00:00"
},
{
"name": "symfony/routing",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "94a3dd89bda078bef0c3bf79eb024fe136dd58f9"
"reference": "445d3629a26930158347a50d1a5f2456c49e0ae6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/94a3dd89bda078bef0c3bf79eb024fe136dd58f9",
"reference": "94a3dd89bda078bef0c3bf79eb024fe136dd58f9",
"url": "https://api.github.com/repos/symfony/routing/zipball/445d3629a26930158347a50d1a5f2456c49e0ae6",
"reference": "445d3629a26930158347a50d1a5f2456c49e0ae6",
"shasum": ""
},
"require": {
@ -2546,20 +2546,20 @@
"uri",
"url"
],
"time": "2018-12-03T13:20:34+00:00"
"time": "2019-01-01T13:45:19+00:00"
},
{
"name": "symfony/translation",
"version": "v4.2.1",
"version": "v4.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "c0e2191e9bed845946ab3d99767513b56ca7dcd6"
"reference": "939fb792d73f2ce80e6ae9019d205fc480f1c9a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/c0e2191e9bed845946ab3d99767513b56ca7dcd6",
"reference": "c0e2191e9bed845946ab3d99767513b56ca7dcd6",
"url": "https://api.github.com/repos/symfony/translation/zipball/939fb792d73f2ce80e6ae9019d205fc480f1c9a0",
"reference": "939fb792d73f2ce80e6ae9019d205fc480f1c9a0",
"shasum": ""
},
"require": {
@ -2619,20 +2619,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2018-12-06T10:45:32+00:00"
"time": "2019-01-03T09:07:35+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v3.4.20",
"version": "v3.4.21",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "6867713afe6c50ade2f34ed6435563b065a52145"
"reference": "a5f39641bb62e8b74e343467b145331273f615a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/6867713afe6c50ade2f34ed6435563b065a52145",
"reference": "6867713afe6c50ade2f34ed6435563b065a52145",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/a5f39641bb62e8b74e343467b145331273f615a2",
"reference": "a5f39641bb62e8b74e343467b145331273f615a2",
"shasum": ""
},
"require": {
@ -2688,7 +2688,7 @@
"debug",
"dump"
],
"time": "2018-11-20T16:10:26+00:00"
"time": "2019-01-01T13:45:19+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@ -2739,16 +2739,16 @@
},
{
"name": "vlucas/phpdotenv",
"version": "v2.5.1",
"version": "v2.5.2",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e"
"reference": "cfd5dc225767ca154853752abc93aeec040fcf36"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e",
"reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/cfd5dc225767ca154853752abc93aeec040fcf36",
"reference": "cfd5dc225767ca154853752abc93aeec040fcf36",
"shasum": ""
},
"require": {
@ -2785,20 +2785,20 @@
"env",
"environment"
],
"time": "2018-07-29T20:33:41+00:00"
"time": "2018-10-30T17:29:25+00:00"
},
{
"name": "yajra/laravel-datatables-oracle",
"version": "v8.13.1",
"version": "v8.13.3",
"source": {
"type": "git",
"url": "https://github.com/yajra/laravel-datatables.git",
"reference": "3d7f05687069d90ca5dc3e75bf269e13eecccc76"
"reference": "387512371d3688f3fe1bf75e3e9e53b3d1426736"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/3d7f05687069d90ca5dc3e75bf269e13eecccc76",
"reference": "3d7f05687069d90ca5dc3e75bf269e13eecccc76",
"url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/387512371d3688f3fe1bf75e3e9e53b3d1426736",
"reference": "387512371d3688f3fe1bf75e3e9e53b3d1426736",
"shasum": ""
},
"require": {
@ -2856,7 +2856,7 @@
"jquery",
"laravel"
],
"time": "2018-11-23T08:05:22+00:00"
"time": "2019-01-05T02:12:47+00:00"
},
{
"name": "zizaco/entrust",

1179
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,10 @@
"jquery": "^3.2",
"laravel-mix": "^4.0.13",
"leaflet": "^1.4.0",
"leaflet-draw": "^1.0.4",
"lodash": "^4.17.11",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"vee-validate": "^2.1.5",
"vue": "^2.5.21",
"vue-events": "^3.1.0",

File diff suppressed because one or more lines are too long

2
public/images/vendor/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -65,8 +65,11 @@
<language>
<xsl:value-of select="@Language" />
</language>
<contributors>
<xsl:apply-templates select="PersonContributor" mode="oai_datacite" />
</contributors>
<resourceType resourceTypeGeneral="Dataset">
<xsl:text>Dataset</xsl:text>
<xsl:text>Dataset</xsl:text>
<!-- <xsl:value-of select="@Type" /> -->
</resourceType>
<rightsList>
@ -74,7 +77,7 @@
</rightsList>
<sizes>
<size>
<xsl:value-of select="count(File)"/>
<xsl:value-of select="count(File)"/>
<xsl:text> datasets</xsl:text>
</size>
</sizes>
@ -147,6 +150,15 @@
</title>
</xsl:template>
<xsl:template match="PersonContributor" mode="oai_datacite">
<contributor>
<contributorName>
<xsl:value-of select="@LastName" />
</contributorName>
</contributor>
</xsl:template>
<xsl:template match="PersonAuthor" mode="oai_datacite">
<creator>
<creatorName>

View File

@ -0,0 +1,143 @@
<template lang="html">
<div>
<div id="map">
</div>
</div>
</template>
<script>
// import "leaflet";
import * as L from "leaflet";
import "leaflet-draw";
//const L = window.L;
export default {
props: {
geolocation: {
type: Object
}
},
data() {
return {
map: [],
markers: null
};
},
computed: {},
watch: {},
methods: {},
mounted() {
const map = L.map("map");
map.scrollWheelZoom.disable();
// Construct a bounding box for this map that the user cannot
var southWest = L.latLng(46.5, 9.9),
northEast = L.latLng(48.9, 16.9),
bounds = L.latLngBounds(southWest, northEast);
// zoom the map to that bounding box
// map.fitBounds(bounds);
var southWest1 = L.latLng(46.35877, 8.782379); //lowerCorner
var northEast1 = L.latLng(49.037872, 17.189532); //upperCorner
var layerBounds = L.latLngBounds(southWest1, northEast1);
var attribution = "www.basemap.at";
var basemap_0 = L.tileLayer(
"https://{s}.wien.gv.at/basemap/bmapgrau/normal/google3857/{z}/{y}/{x}.png",
{
attribution: attribution,
subdomains: ["maps", "maps1", "maps2", "maps3"],
continuousWorld: false,
detectRetina: false,
bounds: layerBounds
}
);
basemap_0.addTo(map);
map.fitBounds(bounds);
this.map = map;
// this.addPlaces(this.places)
// Initialise the FeatureGroup to store editable layers
var drawnItems = new L.FeatureGroup();
map.addLayer(drawnItems);
var drawPluginOptions = {
position: "topright",
draw: {
polygon: false,
// disable toolbar item by setting it to false
polyline: false,
circle: false,
circlemarker: false,
rectangle: {
shapeOptions: {
clickable: true,
color: "#005F6A"
}
},
marker: false
},
edit: {
featureGroup: drawnItems, //REQUIRED!!
remove: false
}
};
// Initialise the draw control and pass it the FeatureGroup of editable layers
var drawControl = new L.Control.Draw(drawPluginOptions);
map.addControl(drawControl);
map.on(
L.Draw.Event.CREATED,
function(event) {
drawnItems.clearLayers();
var type = event.layerType;
var layer = event.layer;
// if (type === "rectancle") {
// layer.bindPopup("A popup!" + layer.getBounds().toBBoxString());
var bounds = layer.getBounds();
this.geolocation.xmin = bounds.getSouthWest().lng;
this.geolocation.ymin = bounds.getSouthWest().lat;
// console.log(this.geolocation.xmin);
this.geolocation.xmax = bounds.getNorthEast().lng;
this.geolocation.ymax = bounds.getNorthEast().lat;
// }
drawnItems.addLayer(layer);
},
this
);
map.on(
L.Draw.Event.EDITED,
function(event) {
var layers = event.layers.getLayers();
var layer = layers[0];
var bounds = layer.getBounds();
this.geolocation.xmin = bounds.getSouthWest().lng;
this.geolocation.ymin = bounds.getSouthWest().lat;
// console.log(this.geolocation.xmin);
this.geolocation.xmax = bounds.getNorthEast().lng;
this.geolocation.ymax = bounds.getNorthEast().lat;
},
this
);
}
};
</script>
// https://github.com/vuejs-templates/webpack/issues/121
// npm install node-sass sass-loader --save-dev
<style lang="scss">
// Import CSS from Leaflet and plugins.
@import "~leaflet/dist/leaflet.css";
@import "~leaflet-draw/dist/leaflet.draw.css";
#map {
width: 100%;
height: 400px;
font-weight: bold;
font-size: 13px;
text-shadow: 0 0 2px #fff;
}
</style>

View File

@ -31,6 +31,7 @@ import axios from 'axios';
import MyAutocomplete from './components/MyAutocomplete.vue';
import VeeValidate from 'vee-validate';
import dataset from './components/Dataset';
import LocationsMap from './components/LocationsMap.vue';
// import { Validator } from 'vee-validate';
Vue.use(VeeValidate);
@ -38,7 +39,7 @@ Vue.use(VeeValidate);
const STATUS_INITIAL = 0, STATUS_SAVING = 1, STATUS_SUCCESS = 2, STATUS_FAILED = 3;
const app = new Vue({
el: '#app',
components: { MyAutocomplete },
components: { MyAutocomplete, LocationsMap },
data() {
return {
rows: [
@ -56,7 +57,7 @@ const app = new Vue({
redirectLink : null,
step: 1,
step: 2,
dataset : dataset
// dataset: {
// type: '',
@ -100,7 +101,7 @@ const app = new Vue({
});
},
mounted() {
this.step = 1;
//this.step = 2;
this.reset();
},
computed: {
@ -124,7 +125,7 @@ const app = new Vue({
this.uploadedFiles = [];
this.uploadError = null;
this.dataset.reset();//reset methods will trigger property changed.
this.step = 1;
this.step = 2;
},
retry() {
// reset form to initial state

View File

@ -143,24 +143,25 @@
<fieldset id="fieldset-titles">
<legend>Bounding Box</legend>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Xmin', 'xmin: ') !!}
{!! Form::text('GeoLocation[xmin]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.xmin']) !!}
<div class="pure-u-1 pure-u-md-1 pure-u-lg-1 pure-div">
<locations-map v-bind:geolocation="dataset.geolocation"></locations-map>
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Ymin', 'ymin: ') !!}
{!! Form::text('GeoLocation[ymin]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.ymin']) !!}
{!! Form::label('xmin', 'xmin: ') !!}
{!! Form::text('xmin', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.xmin', 'readonly']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('ymin', 'ymin: ') !!}
{!! Form::text('ymin', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.ymin', 'readonly']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Xmax', 'xmax: ') !!}
{!! Form::text('GeoLocation[xmax]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.xmax']) !!}
{!! Form::label('xmax', 'xmax: ') !!}
{!! Form::text('xmax', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.xmax', 'readonly']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('Ymax', 'ymax: ') !!}
{!! Form::text('GeoLocation[ymax]', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.ymax']) !!}
{!! Form::label('ymax', 'ymax: ') !!}
{!! Form::text('ymax', null, ['class' => 'pure-u-23-24', 'v-model' => 'dataset.geolocation.ymax', 'readonly']) !!}
</div>
</div>
</fieldset>