Hello, installed my tile server and it is working on localhost/osm I already installed Nominatim an after several hours I finally manage to point it to localhots/osm (I don't know how but it is working with only my country map). Now I have installed the Rails Port and JOMS but none of them pulls data from my local tile server. I have serched and read a lot of treads about this but all are poor explained like "change the a.tile.openstreetmap.... for your tile server addres" but without examples so I don't know if the part "a.tile" is necessary or not. My goal is to be able to edit the map of my local tile server (web or JOSM) and update the tiles and database so I can searh what I add to my maps with Nominatim. Please give me a easy to follow guide to use muy local tile server to edit, search, and display data in my webpage without touching openstreetmap.org data (is this the porpuse of local tile server?). My system is> ubuntu 14.04 LTS 64 bits on VirtualBox over windows 7 Professional 64 bits Any help will be appreciated asked 21 Sep '14, 03:18 eyemax |
(answering the easy bit of the question first) In JOSM: Edit / Preferences / "World" (2nd vertical tab), then:
permanent link
This answer is marked "community wiki".
answered 10 Dec '14, 08:53 SomeoneElse ♦ I actually can see the slippy map page at http://localhost/osm/slippymap.html If I set the url to: http://localhost/osm or to http://localhost I get the fallowing error when I hit Valiate: "Faied to retrieve a list of changesets from the OSM API server at 'http://localhost'. The server responded with teh return code 404 instead of 200. Please check the spelling of 'http://localhost' and validate again." Can you give some examples of this URL or tell me how can I find the url to my server?
(10 Dec '14, 19:25)
eyemax
One example of this URL is shown in JOSM on that screen - https://api.openstreetmap.org/api . You'll want to use something based on wherever you've installed the Rails port.
(10 Dec '14, 20:36)
SomeoneElse ♦
|
to use local tiles in rails port website, you should edit this two files :
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: document.location.protocol === 'https:' ?
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' :
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
maxZoom: 19
}
});
*/
L.OSM.TileLayer = L.TileLayer.extend({ options: { url: document.location.protocol === 'http:' ? 'http://localhost/osm_tiles/{z}/{x}/{y}.png' : 'http://localhost/osm_tiles/{z}/{x}/{y}.png', attribution: '© OpenStreetMap 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: document.location.protocol === 'http:' ? 'http://localhost/osm_tiles/{z}/{x}/{y}.png' : 'http://localhost/osm_tiles/{z}/{x}/{y}.png', maxZoom: 19 } }); restart the rails port : sudo bundle exec rails server and you are done :-) answered 05 Apr '15, 12:37 spirea Sorry, buts its not clear, what lines are to comment and what lines are to add?
(09 Jul '19, 19:10)
carlosguedes
|
For me that didn't work. You can check what URL is used in browser (for example firefox - r-click inspect element, look at the error messages). I had to hard code entire URL, simply: L.OSM.TileLayer = L.TileLayer.extend({ options: { url: 'http://my_domain/osm_tiles/{z}/{x}/{y}.png', attribution: '© OpenStreetMap 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: 'http://my_domain/osm_tiles/{z}/{x}/{y}.png', maxZoom: 19 } }); answered 03 Nov '15, 10:33 jorax http://localhost/... to access local on PC http://<your_ip>/... to access from local netwotk
(16 Jan '19, 11:59)
perosoft
|
For your rails port problem try asking on IRC at #osm-dev or on the mailing lists at dev or rails-dev. For JOSM choose #josm or josm-dev. If someone is able to solve your problems please post the solutions here.