-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 14bf276
Showing
8 changed files
with
114 additions
and
0 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 @@ | ||
build/farmOS-map.js |
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,12 @@ | ||
# Inherit from the official node.js image. | ||
FROM node | ||
|
||
# Set the working directory to /usr/src/app. | ||
WORKDIR /usr/src/app | ||
|
||
# Install dependencies. | ||
COPY package.json package.json | ||
RUN npm install | ||
|
||
# Copy source files needed for running npm build. | ||
COPY src/ . |
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,25 @@ | ||
# farmOS Map | ||
|
||
[![Licence](https://img.shields.io/badge/Licence-GPL%203.0-blue.svg)](https://opensource.org/licenses/GPL-3.0/) | ||
[![Release](https://img.shields.io/github/release/farmOS/farmOS-map.svg?style=flat)](https://github.com/farmOS/farmOS-map/releases) | ||
[![Last commit](https://img.shields.io/github/last-commit/farmOS/farmOS-map.svg?style=flat)](https://github.com/farmOS/farmOS-map/commits) | ||
[![Twitter](https://img.shields.io/twitter/follow/farmOSorg.svg?label=%40farmOSorg&style=flat)](https://twitter.com/farmOSorg) | ||
[![Chat](https://img.shields.io/matrix/farmOS:matrix.org.svg)](https://riot.im/app/#/room/#farmOS:matrix.org) | ||
|
||
farmOS Map is an [OpenLayers](https://openlayers.org/) map for farmOS. | ||
|
||
For more information on farmOS, visit [farmOS.org](https://farmOS.org). | ||
|
||
## Setup | ||
|
||
1. Clone the repository. | ||
2. Run `./build.sh` | ||
3. Open `build/index.html` in a browser. | ||
|
||
## Maintainers | ||
|
||
* Michael Stenta (m.stenta) - https://github.com/mstenta | ||
|
||
This project has been sponsored by: | ||
|
||
* [Farmier](https://farmier.com) |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# Touch build/farmOS-map.js to ensure that it is owned by this user. | ||
touch build/farmOS-map.js | ||
|
||
# Build the farmos-map Docker image. | ||
sudo docker build -t farmos-map . | ||
|
||
# Build farmOS-map.js with NPM. | ||
sudo docker run -it --rm -v "$PWD/build":/usr/src/app/build farmos-map npm run build |
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,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>farmOS Map</title> | ||
<link rel="stylesheet" href="https://openlayers.org/en/latest/css/ol.css" type="text/css"> | ||
<style> | ||
html, body { | ||
margin: 0; | ||
height: 100%; | ||
} | ||
#map { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="map"></div> | ||
<script src="./farmOS-map.js"></script> | ||
</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,15 @@ | ||
{ | ||
"name": "farmOS-map", | ||
"version": "0.0.1", | ||
"description": "OpenLayers map used in farmOS.", | ||
"scripts": { | ||
"build": "webpack --config webpack.config.js --mode production" | ||
}, | ||
"devDependencies": { | ||
"webpack": "^4.29.6", | ||
"webpack-command": "^0.3.0" | ||
}, | ||
"dependencies": { | ||
"ol": "^5.3.0" | ||
} | ||
} |
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,18 @@ | ||
import { Map, View } from 'ol'; | ||
import TileLayer from 'ol/layer/Tile'; | ||
import XYZ from 'ol/source/XYZ'; | ||
|
||
new Map({ | ||
target: 'map', | ||
layers: [ | ||
new TileLayer({ | ||
source: new XYZ({ | ||
url: 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png', | ||
}), | ||
}), | ||
], | ||
view: new View({ | ||
center: [0, 0], | ||
zoom: 2, | ||
}), | ||
}); |
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,9 @@ | ||
const webpack = require('webpack'); | ||
|
||
module.exports = { | ||
entry: './main.js', | ||
output: { | ||
path: __dirname + '/build', | ||
filename: 'farmOS-map.js' | ||
}, | ||
}; |