Skip to content

Commit

Permalink
📦 Include compiled CSS and JS
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelien committed Oct 17, 2018
1 parent 6cae37b commit 4031ba7
Show file tree
Hide file tree
Showing 17 changed files with 5,480 additions and 44 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
node_modules/
vendor/
composer.lock
config.yml
public/drawing-tool.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you want to export the geometry with several Spatial Reference Systems (SRS),

### Example

```
```yaml
---
postgresql:
host: "localhost"
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "geo6/drawing-tool",
"description": "Draw an area and export it using ogr2ogr in several formats",
"type": "project",
"license": "GPL-3.0",
"description": "Draw an area and export it using ogr2ogr in several formats",
"license": "GPL-3.0-or-later",
"authors": [
{
"name": "Jonathan Beliën"
}
{
"name": "Jonathan Beliën",
"email": "jbe@geo6.be"
}
],
"require": {
"symfony/yaml": "^4.0"
"symfony/yaml": "4.1.6"
}
}
135 changes: 135 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions index.php

This file was deleted.

6 changes: 4 additions & 2 deletions js/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ var that = this;
exports.featuresLoad = function () {
var features = new ol.Collection();
var featureOverlay = new ol.layer.Vector({
source: new ol.source.Vector({features: features}),
source: new ol.source.Vector({
features: features
}),
style: new ol.style.Style({
fill: new ol.style.Fill({
color: "rgba(255, 255, 255, 0.5)"
Expand Down Expand Up @@ -68,7 +70,7 @@ exports.addInteraction = function () {
draw.on("drawstart", function (event) {
global.features.clear();

var listener = event.feature.getGeometry().on("change", function(event) {
var listener = event.feature.getGeometry().on("change", function (event) {
var geom = event.target;
var output;
var radius;
Expand Down
2 changes: 1 addition & 1 deletion js/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var wgs84Sphere = new ol.Sphere(6378137);
exports.formatArea = function (polygon, proj) {
var area;
var sourceProj = proj || global.map.getView().getProjection();
var geom = /** @type {ol.geom.Polygon} */(polygon.clone().transform(sourceProj, "EPSG:4326"));
var geom = /** @type {ol.geom.Polygon} */ (polygon.clone().transform(sourceProj, "EPSG:4326"));
var coordinates = geom.getLinearRing(0).getCoordinates();

area = Math.abs(wgs84Sphere.geodesicArea(coordinates));
Expand Down
16 changes: 8 additions & 8 deletions js/geocode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ module.exports = function (event) {
$(li).css("background", "url(" + item.icon + ") no-repeat left");
}

$(li).
attr("title", item.class + " : " + item.type).
append(item.display_name).
data({
$(li)
.attr("title", item.class + " : " + item.type)
.append(item.display_name)
.data({
"lat": parseFloat(item.lat),
"lng": parseFloat(item.lon)
});
Expand All @@ -41,15 +41,15 @@ module.exports = function (event) {
var data = $(this).data();

if (item.class !== "boundary") {
global.map.getView().
animate({
global.map.getView()
.animate({
"center": ol.proj.fromLonLat([data.lng, data.lat]),
"duration": 0,
"zoom": 18
});
} else {
global.map.getView().
fit(ol.proj.transformExtent([parseFloat(item.boundingbox[2]), parseFloat(item.boundingbox[0]), parseFloat(item.boundingbox[3]), parseFloat(item.boundingbox[1])], "EPSG:4326", global.map.getView().getProjection()), {
global.map.getView()
.fit(ol.proj.transformExtent([parseFloat(item.boundingbox[2]), parseFloat(item.boundingbox[0]), parseFloat(item.boundingbox[3]), parseFloat(item.boundingbox[1])], "EPSG:4326", global.map.getView().getProjection()), {
"minResolution": 18
});
}
Expand Down
2 changes: 1 addition & 1 deletion js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var geocode = require("./geocode.js");
var draw = require("./draw.js");
var municipality = require("./municipality.js");

proj4.defs("EPSG:31370","+proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747 +units=m +no_defs");
proj4.defs("EPSG:31370", "+proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747 +units=m +no_defs");

$(document).ready(function () {
global.map = require("./map.js")();
Expand Down
8 changes: 5 additions & 3 deletions js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ module.exports = function () {
layers: [
new ol.layer.Tile({
source: new ol.source.OSM({
url: "//tile.osm.be/osmbe/{z}/{x}/{y}.png",
attributions: [ ol.source.OSM.ATTRIBUTION, "Tiles courtesy of <a href=\"https://geo6.be/\">GEO-6</a>" ]
url: "https://tile.osm.be/osmbe/{z}/{x}/{y}.png",
attributions: [ol.source.OSM.ATTRIBUTION, "Tiles courtesy of <a href=\"https://geo6.be/\">GEO-6</a>"]
})
})
],
controls: ol.control.defaults({attribution: false}).extend([attribution, scale]),
controls: ol.control.defaults({
attribution: false
}).extend([attribution, scale]),
target: "map",
view: new ol.View({
center: ol.proj.fromLonLat([4.45, 50.5157]),
Expand Down
Loading

0 comments on commit 4031ba7

Please sign in to comment.