rails server + nominatim + tiles server offline

romeo romeo.petruca at perosoft.org
Wed Jan 16 17:31:11 UTC 2019


Hi,

I have rails server + nominatim + tiles server offline working together, 
tested on pc without internet connection.

I used this:

https://help.openstreetmap.org/questions/36946/set-railsport-and-josm-to-use-local-tile-server

changed in openstreetmap-website/vendor/assets/openlayer/OpenStreetMap.js
/*
         var url = [
             "https://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
             "https://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
             "https://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
         ];

*/
         var url = [
//            "http://192.168.1.161/hot/${z}/${x}/${y}.png",
             "http://localhost/hot/${z}/${x}/${y}.png",
         ];
and,

in openstreetmap-website/vendor/assets/leaflet/leaflet.osm.js

L.OSM.TileLayer = L.TileLayer.extend({
   options: {
//    url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
//    url: 'http://192.168.1.161/hot/{z}/{x}/{y}.png',
     url: 'http://localhost/hot/{z}/{x}/{y}.png',
     attribution: '© OpenStreetMap contributors'
//    attribution: '© <a href="https://www.openstreetmap.org/copyright" 
target="_blank">OpenStreetMap</a> contributors'
   },

   initialize: function (options) {
     options = L.Util.setOptions(this, options);
     L.TileLayer.prototype.initialize.call(this, options.url);
   }
});


L.OSM.Mapnik = L.OSM.TileLayer.extend({
   options: {
//    url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
//    url: 'http://192.168.1.161/hot/{z}/{x}/{y}.png',
     url: 'http://localhost/hot/{z}/{x}/{y}.png',
     maxZoom: 19
   }
});

where url: 'http://<your_pc_ip>/....' is to access rails server from 
local network.
and 'localhost/hot/' is my server


now another problem, id editor not saving data modified on map.

In editor i see modification, in left panel, but on map no modifcations.

I asume ID editor trying to save to openstreetmap.org.

How can i redirect ID to save on local OSM ?





More information about the rails-dev mailing list