Server returned HTTP response code: 429

Apologies if this is the wrong place to post this!

I pulled a copy of OSM from~ https://github.com/openstreetmap

I made a trivial entry point into it. And I’m getting a Server returned HTTP response code: 429

I’ve done no other configurations that I’m aware of, and the JMapViewer doesn’t have other parameters for further configurations. It also worked at some point as well.


import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import org.openstreetmap.gui.jmapviewer.JMapViewer;

public class NewClass {

	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.setLayout(new BorderLayout());
		frame.add(new JMapViewer(), BorderLayout.CENTER);
		frame.setSize(new Dimension(1200, 800));
		frame.setVisible(true);
	}
}

Any ideas on what I might need to change or add? Thanks!

Edit: Sample error lines I’m getting:

Failed loading https://c.tile.openstreetmap.org/3/3/2.png: class java.io.IOException: Server returned HTTP response code: 429 for URL: https://b.tile.openstreetmap.org/3/3/2.png
Failed loading https://b.tile.openstreetmap.org/3/1/2.png: class java.io.IOException: Server returned HTTP response code: 429 for URL: https://a.tile.openstreetmap.org/3/1/2.png
Failed loading https://a.tile.openstreetmap.org/3/3/4.png: class java.io.IOException: Server returned HTTP response code: 429 for URL: https://c.tile.openstreetmap.org/3/3/4.png
Failed loading https://c.tile.openstreetmap.org/3/4/1.png: class java.io.IOException: Server returned HTTP response code: 429 for URL: https://b.tile.openstreetmap.org/3/4/1.png
Failed loading https://b.tile.openstreetmap.org/3/4/4.png: class java.io.IOException: Server returned HTTP response code: 429 for URL: https://a.tile.openstreetmap.org/3/4/4.png

The result is a frame with lots of red “X” tiles.

Which one did you pull a copy of? There are over 40 different repositories there. We’ll need to know if you’re trying to set up a tile renderer, a router, a clone of the osm.org website, an editor, a geocoder, etc.

https://github.com/balloob/JMapViewer/tree/master/org/openstreetmap/gui/jmapviewer

I think I’m using the JMapViewer from this one.~

You are being blocked because you are not setting an application specific user agent string as required by the OSMF ToU.

Thanks! How do we add a specific user agent string? o.o I don’t see any options in the class constructor.