Skip to content

Commit

Permalink
Merge pull request #105 from ArcaneDots/gh-pages
Browse files Browse the repository at this point in the history
Sabas merge
  • Loading branch information
iandees authored Jan 16, 2023
2 parents 1c9cb78 + a325138 commit 529a06b
Show file tree
Hide file tree
Showing 58 changed files with 12,681 additions and 553 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# [onosm.org](https://onosm.org/)
# OnOSM

OnOSM helps business owners provide structured data about their shop. The result is written to an anonymous [OpenStreetMap Note](https://wiki.openstreetmap.org/wiki/Notes). See [recently created notes](https://ent8r.github.io/NotesReview/?query=submitted%20note%20from%20a%20business).
An easy way to get a business on to OpenStreetMap.

## Description

OnOSM helps business owners provide structured data about their shop. The result is written to an anonymous [Note](https://wiki.openstreetmap.org/wiki/Notes) that is placed on the map. To see examples previously created notes, take a look at [recently created notes](https://ent8r.github.io/NotesReview/?query=submitted%20note%20from%20a%20business) using NoteReview, another community developed application.

## Available languages

Application defaults to displaying text in British English. Alternate translations are also available. They can be selected at anytime using the drop-down at the top of the page.

## Contributing

Expand All @@ -11,6 +19,12 @@ General notes
* Prefer 4 space soft tab in javascript
* For UI changes, don't forget to include a screenshot or two in the pull request

## See Also
## Wiki

* [onosm.org on the OpenStreetMap wiki](https://wiki.openstreetmap.org/wiki/Onosm.org)

## Licenses

- Twemoji emojis by Twitter licensed under [CC-BY 4.0](https://github.com/twitter/twemoji/blob/master/LICENSE-GRAPHICS)
- Twemoji awesome licensed under [MIT](https://github.com/SebastianAigner/twemoji-amazing)

112 changes: 112 additions & 0 deletions active.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="it">
<title>Active OnOSM Notes</title>
<link rel="stylesheet" href="https://necolas.github.io/normalize.css/2.1.3/normalize.css" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="css/Leaflet.EditInOSM.css" />
<script src="js/Leaflet.EditInOSM.js"></script>

<script src="js/leaflet-hash.js"></script>

<script type="text/javascript">
//https://code.google.com/p/microajax/
function microAjax(B,A){this.bindFunction=function(E,D){return function(){return E.apply(D,[D])}};this.stateChange=function(D){if(this.request.readyState==4){this.callbackFunction(this.request.responseText)}};this.getRequest=function(){if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}return false};this.postBody=(arguments[2]||"");this.callbackFunction=A;this.url=B;this.request=this.getRequest();if(this.request){var C=this.request;C.onreadystatechange=this.bindFunction(this.stateChange,this);if(this.postBody!==""){C.open("POST",B,true);C.setRequestHeader("X-Requested-With","XMLHttpRequest"); C.setRequestHeader("Content-type","application/x-www-form-urlencoded");C.setRequestHeader("Connection","close")}else{C.open("GET",B,true)}C.send(this.postBody)}};
</script>
<link href='https://fonts.googleapis.com/css?family=Ledger&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<style>
body{
font-family:Ledger,serif;
}
#mapdiv{
position:fixed;
top:0;
right:0;
width:75%;
bottom:0;
}
#text{
width:25%;
}

@media all and (max-width:600px)
{
#text{
height:25%;
width:100%;
overflow-y:scroll;
}
#mapdiv{
position:fixed;
top:auto;
left:0;
right:0;
height:75%;
width:100%;
bottom:0;
}
}
</style>
</head>
<body>
<div id="text">

</div>
<div id="mapdiv"></div>
<script type="text/javascript">
var lat=41.992,
lon=12.393,
zoom=5;
var osm = new L.TileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {maxZoom: 19, attribution: 'Map Data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'});
var cyclemap = new L.TileLayer('https://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', {maxZoom: 18, attribution: 'Map Data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'});
var mapquest = new L.TileLayer('https://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png', {subdomains: '1234', maxZoom: 18, attribution: 'Map Data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'});

var map = new L.Map('mapdiv', {
editInOSMControl: true,
editInOSMControlOptions: {
position: "topright"
},
center: new L.LatLng(lat, lon),
zoom: zoom,
layers: [osm]
});

var baseMaps = {
"Mapnik": osm,
"OpenCycleMap": cyclemap,
"Mapquest Open": mapquest
};
L.control.layers(baseMaps).addTo(map);

var hash = new L.Hash(map);

var ico=L.icon({iconUrl:'img/Open_note_marker.png', iconSize:[25,40],iconAnchor:[12,40],popupAnchor: [0, -40] });

function loadLayer(url)
{
var geojson = L.geoJson(url,{
onEachFeature:function onEachFeature(feature, layer) {
if (feature.properties && feature.properties.id) {
var url="https://www.openstreetmap.org/note/"+feature.properties.id;
layer.bindPopup("URL: <a href='"+url+"'>"+url+"</a><br/>Data: "+feature.properties.date_created);
}
},
pointToLayer: function (feature, latlng) {
var marker=L.marker(latlng, {icon:ico});
return marker;
}
});

map.addLayer(geojson);
}

var httpurl="https://api.openstreetmap.org/api/0.6/notes/search.json?q=su.openstreetmap.it&closed=0&limit=100";
microAjax(httpurl,function (res) {
var feat=JSON.parse(res);
loadLayer(feat);
} );
</script>
</body>
</html>
34 changes: 34 additions & 0 deletions css/L.Control.Locate.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Compatible with Leaflet 0.6 */

.leaflet-touch .leaflet-bar-part-single {
-webkit-border-radius: 7px 7px 7px 7px;
border-radius: 7px 7px 7px 7px;
border-bottom: none;
}

.leaflet-control-locate a {
background-image: url(locate_alt.png);
background-position: -2px -2px;
}

.leaflet-touch .leaflet-control-locate a {
background-image: url(locate_touch_alt.png);
}

.leaflet-control-locate.requesting a {
background-image: url(spinner.gif);
background-position: 50% 50%;
}

.leaflet-control-locate.active a {
background-position: -32px -2px;
}

.leaflet-control-locate.active.following a {
background-position: -62px -2px;
}

.leaflet-touch .leaflet-control-locate {
box-shadow: none;
border: 4px solid rgba(0,0,0,0.3);
}
12 changes: 12 additions & 0 deletions css/L.Control.Locate.ie.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* Conditional stylesheet for IE. */
.leaflet-control-locate {
border: 3px solid #999;
}

.leaflet-control-locate a {
background-color: #eee;
}

.leaflet-control-locate a:hover {
background-color: #fff;
}
43 changes: 43 additions & 0 deletions css/Leaflet.EditInOSM.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.leaflet-control-edit-in-osm {
background: none repeat scroll 0 0 #F8F8F9;
border: 1px solid #888888;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}
.leaflet-control-edit-in-osm .leaflet-control-edit-in-osm-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
height: 36px;
width: 36px;
display: block;
}
.leaflet-control-edit-in-osm .leaflet-control-edit-in-osm-toggle {
background-image: url("./edit-in-osm.png");
}
.leaflet-control-edit-in-osm .osm-editor + .osm-editor {
border-left: 1px solid black;
}
.leaflet-control-edit-in-osm a.osm-editor {
display: none;
height: 36px;
min-width: 36px;
text-align: center;
line-height: 36px;
color: #333;
padding: 0 5px;
text-decoration: none;
font-family: sans-serif;
}
.leaflet-control-edit-in-osm:hover a.osm-editor {
display: inline-block;
}
a.osm-editor:hover {
box-shadow: 0 0 2px 0 black inset;
}
.leaflet-control-edit-in-osm:hover .leaflet-control-edit-in-osm-toggle {
display: none;
}

.leaflet-control-edit-hidden {
display: none;
}
Binary file added css/edit-in-osm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/locate_alt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/locate_touch_alt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/select2-spinner.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/select2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/select2x2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/spinner.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 529a06b

Please sign in to comment.