Map Tile Layer Not Working

63 views
Skip to first unread message

Stefano Gelli

unread,
Nov 19, 2019, 6:27:47 AM11/19/19
to openmap-users
Hi All,
I've been using Openmap for a while and now I'm trying to focus on some performance issues I have on my application with WMS and Tiles loading.
I'm trying to add a MapTileLayer to the SimpleMap2 Application. The layer is there (I can see from the Layer Control menu) and is enabled but no Tile is displayed.
I'm on OpenJDK 1.8.0. and developing with Netbeans. I did a lot of tests, also with older version of OpenMap (5.0.3)...but nothing to do. I can't figure out the problem.

Can you please tell me if I'm doing something wrong?

This is what I added to the SimpleMap2.java code

       //MapTile
        MapTileLayer mapTileLayer = new MapTileLayer();
        mapTileLayer.setName("MTL");
        Properties tileProperties = new Properties();
        tileProperties.setProperty("rootDir", "http://c.tile.openstreetmap.org/");
        mapTileLayer.setProperties(tileProperties);
        mapTileLayer.setVisible(true);
        mapPanel.getMapHandler().add(mapTileLayer);

Thank you very much
Ciao,
Stefano

Don Dietrick

unread,
Nov 19, 2019, 9:56:27 AM11/19/19
to Stefano Gelli, openmap-users
Hi Stefano,

I don’t think you’re doing anything wrong - when I drop your code into SimpleMap2 I get the same behavior.  When I turn on debugging, the URLS that are being generated for the tiles look ok, and if you drop those URLS directly into a browser the images come up, but they come up after being redirected to a https connection.  So, I think that’s where the problem comes in - the tile.openstreemap.org server is redirecting the query to a different protocol and the OpenMap layer doesn’t know how to deal with it.  I think the ServerMapTileFactory code has to be updated to handle SSL in order to connect to those servers.

Thanks for the heads-up,

Don



--
You received this message because you are subscribed to the Google Groups "openmap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openmap-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openmap-users/6de867ea-aa95-473f-874d-018e9c14d9f7%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages