Compare commits

...

6 Commits
main ... v2.2.1

Author SHA1 Message Date
louis-e
449fcc18bd Remove unused leaflet.draw.override.js 2025-05-19 17:18:15 +02:00
louis-e
c69e124eb5 Switch map provider from Mapbox to OSM 2025-05-19 17:11:33 +02:00
Louis Erbkamm
7956826c07 Update release.yml 2025-05-18 16:48:02 +02:00
Louis Erbkamm
acbe9adedf Update tauri.conf.json 2025-05-18 16:24:25 +02:00
Louis Erbkamm
4ec8f65e6f Update version 2025-05-18 16:23:59 +02:00
louis-e
fd2d4b272b Mapbox key hotfix 2025-05-18 16:21:06 +02:00
9 changed files with 75 additions and 102 deletions

View File

@@ -26,7 +26,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@v1
@@ -83,7 +83,7 @@ jobs:
shell: powershell
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-build
path: target/release/${{ matrix.asset_name }}
@@ -96,19 +96,19 @@ jobs:
uses: actions/checkout@v3
- name: Download Windows build artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: windows-latest-build
path: ./builds/windows
- name: Download Linux build artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ubuntu-latest-build
path: ./builds/linux
- name: Download macOS build artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: macos-latest-build
path: ./builds/macos
@@ -119,11 +119,11 @@ jobs:
chmod +x ./builds/macos/arnis-mac
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
builds/windows/arnis-windows.exe
builds/linux/arnis-linux
builds/macos/arnis-mac
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

2
Cargo.lock generated
View File

@@ -168,7 +168,7 @@ dependencies = [
[[package]]
name = "arnis"
version = "2.2.0"
version = "2.2.1"
dependencies = [
"clap",
"colored",

View File

@@ -1,6 +1,6 @@
[package]
name = "arnis"
version = "2.2.0"
version = "2.2.1"
edition = "2021"
description = "Arnis - Generate real life cities in Minecraft"
homepage = "https://github.com/louis-e/arnis"

85
gui-src/js/bbox.js vendored
View File

@@ -322,7 +322,7 @@ function addLayer(layer, name, title, zIndex, on) {
}
link.innerHTML = name;
link.title = title;
link.onclick = function(e) {
link.onclick = function (e) {
e.preventDefault();
e.stopPropagation();
@@ -456,13 +456,19 @@ $(document).ready(function () {
** on top of your DOM
**
*/
$('input[type="textarea"]').on('click', function (evt) { this.select() });
// Have to init the projection input box as it is used to format the initial values
// init the projection input box as it is used to format the initial values
$('input[type="textarea"]').on('click', function (evt) { this.select() });
$("#projection").val(currentproj);
L.mapbox.accessToken = 'pk.eyJ1IjoiY3Vnb3MiLCJhIjoiY2p4Nm43MzA3MDFmZDQwcGxsMjB4Z3hnNiJ9.SQbnMASwdqZe6G4n6OMvVw';
map = L.mapbox.map('map').setView([50.114768, 8.687322], 4).addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));
// Initialize map with OpenStreetMap tiles
map = L.map('map').setView([50.114768, 8.687322], 4);
// Add OpenStreetMap tile layer (free to use with attribution)
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; Map data from <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
maxZoom: 19
}).addTo(map);
rsidebar = L.control.sidebar('rsidebar', {
position: 'right',
@@ -498,14 +504,25 @@ $(document).ready(function () {
// Initialize the FeatureGroup to store editable layers
drawnItems = new L.FeatureGroup();
map.addLayer(drawnItems);
// Initialize the draw control and pass it the FeatureGroup of editable layers
map.addLayer(drawnItems); // Initialize the draw control and pass it the FeatureGroup of editable layers
drawControl = new L.Control.Draw({
edit: {
featureGroup: drawnItems
},
draw: {
rectangle: {
shapeOptions: {
color: '#fe57a1',
opacity: 0.6,
weight: 3,
fillColor: '#fe57a1',
fillOpacity: 0.1,
dashArray: '10, 10',
lineCap: 'round',
lineJoin: 'round'
},
repeatMode: false
},
polyline: false,
polygon: false,
circle: false,
@@ -513,7 +530,6 @@ $(document).ready(function () {
}
});
map.addControl(drawControl);
/*
**
** create bounds layer
@@ -523,17 +539,22 @@ $(document).ready(function () {
**
*/
startBounds = new L.LatLngBounds([0.0, 0.0], [0.0, 0.0]);
var bounds = new L.Rectangle(startBounds,
{
fill: false,
opacity: 1.0,
color: '#000'
}
);
var bounds = new L.Rectangle(startBounds, {
color: '#3778d4',
opacity: 1.0,
weight: 3,
fill: '#3778d4',
lineCap: 'round',
lineJoin: 'round'
});
bounds.on('bounds-set', function (e) {
// move it to the end of the parent
var parent = e.target._renderer._container.parentElement;
$(parent).append(e.target._renderer._container);
// move it to the end of the parent if renderer exists
if (e.target._renderer && e.target._renderer._container) {
var parent = e.target._renderer._container.parentElement;
$(parent).append(e.target._renderer._container);
}
// Set the hash
var southwest = this.getBounds().getSouthWest();
var northeast = this.getBounds().getNorthEast();
@@ -543,8 +564,21 @@ $(document).ready(function () {
var ymax = northeast.lat.toFixed(6);
location.hash = ymin + ',' + xmin + ',' + ymax + ',' + xmax;
});
map.addLayer(bounds)
map.addLayer(bounds);
map.on('draw:created', function (e) {
// Check if it's a rectangle and set proper styles before adding it to the layer
if (e.layerType === 'rectangle') {
e.layer.setStyle({
color: '#3778d4',
opacity: 1.0,
weight: 3,
fill: '#3778d4',
lineCap: 'round',
lineJoin: 'round'
});
}
drawnItems.addLayer(e.layer);
bounds.setBounds(drawnItems.getBounds())
$('#boxbounds').text(formatBounds(bounds.getBounds(), '4326'));
@@ -629,7 +663,14 @@ $(document).ready(function () {
var splitBounds = initialBBox.split(',');
startBounds = new L.LatLngBounds([splitBounds[0], splitBounds[1]],
[splitBounds[2], splitBounds[3]]);
var lyr = new L.Rectangle(startBounds);
var lyr = new L.Rectangle(startBounds, {
color: '#3778d4',
opacity: 1.0,
weight: 3,
fill: '#3778d4',
lineCap: 'round',
lineJoin: 'round'
});
var evt = {
layer: lyr,
layerType: "polygon",
@@ -654,4 +695,4 @@ $(document).ready(function () {
function notifyBboxUpdate() {
const bboxText = document.getElementById('boxbounds').textContent;
window.parent.postMessage({ bboxText: bboxText }, '*');
}
}

View File

@@ -10,7 +10,7 @@ RedAuburn<br>
daniil2327<br>
benjamin051000<br>
<p>For a full list of contributors, please refer to the <a href="https://github.com/louis-e/arnis" style="color: inherit;" target="_blank">Github page</a>. Logo made by nxfx21.</p>
<p>For a full list of contributors, please refer to the <a href="https://github.com/louis-e/arnis" style="color: inherit;" target="_blank">Github page</a>. Logo made by nxfx21. Map data from <a href="https://www.openstreetmap.org/copyright" style="color: inherit;" target="_blank">OpenStreetMap</a>.</p>
<p style="color: #ff7070;"><b>Download Arnis only from the official source:</b> <a href="https://github.com/louis-e/arnis" style="color: inherit;" target="_blank">https://github.com/louis-e/arnis/</a>. Every other website providing a download and claiming to be affiliated with the project is unofficial and may be malicious.</p>

View File

File diff suppressed because one or more lines are too long

2
gui-src/maps.html vendored
View File

@@ -7,13 +7,11 @@
<link rel="stylesheet" href="css/maps/leaflet.css" />
<link rel="stylesheet" href="css/maps/leaflet.draw.css" />
<link rel="stylesheet" href="css/maps/leaflet.sidebar.css" />
<link rel="stylesheet" href="css/maps/mapbox.v3.2.0.css" />
<link rel="stylesheet" href="css/bbox.css" />
<script src="js/libs/jquery-1.9.1.min.js"></script>
<script src="js/libs/jquery-ui-1.10.3.custom.js"></script>
<script src="js/maps/leaflet.js"></script>
<script src="js/maps/mapbox.v3.2.0.js"></script>
<script src="js/maps/leaflet.draw.js"></script>
<script src="js/maps/leaflet.sidebar.js"></script>
<script src="js/maps/wkt.parser.js"></script>

View File

@@ -9,7 +9,7 @@ const MAX_Y: i32 = 256;
const BASE_HEIGHT_SCALE: f64 = 0.6;
/// Mapbox API access token for terrain data
const MAPBOX_PUBKEY: &str =
"pk.eyJ1IjoiY3Vnb3MiLCJhIjoiY2p4Nm43MzA3MDFmZDQwcGxsMjB4Z3hnNiJ9.SQbnMASwdqZe6G4n6OMvVw";
"pk.eyJ1IjoibG91aXMtZSIsImEiOiJjbWF0cWlycjEwYWNvMmtxeHFwdDQ5NnJoIn0.6A0AKg0iucvoGhYuCkeOjA";
/// Minimum zoom level for terrain tiles
const MIN_ZOOM: u8 = 10;
/// Maximum zoom level for terrain tiles

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Arnis",
"version": "2.2.0",
"version": "2.2.1",
"identifier": "com.louisdev.arnis",
"build": {
"frontendDist": "gui-src"