Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addTiles does not allow display of self-hosted vector tiles #905

Open
asitemade4u opened this issue Mar 4, 2024 · 0 comments
Open

addTiles does not allow display of self-hosted vector tiles #905

asitemade4u opened this issue Mar 4, 2024 · 0 comments

Comments

@asitemade4u
Copy link

asitemade4u commented Mar 4, 2024

Hi,

[I am unable to include a reprex since the issue relies on a locally self-hosted vector map tile server, pg_tileserv]

  • I have a self-hosted pg_tileservvector map tile server on our network, with a local address (192.168.1.88:7808).
  • I am able to display a map it serves into a leaflet HTML file:
      var map = L.map('map').setView([40.758896,-73.985130],11);
      // Add the vector tile layer to the map from my server
      var vectorServer = "http://192.168.1.88:7808/";
      var vectorLayerId = "ara.prk";
      var vectorUrl = vectorServer + vectorLayerId + "/{z}/{x}/{y}.pbf";
      //...
      var vectorLayer = L.vectorGrid.protobuf(vectorUrl,vectorTileOptions).addTo(map);
  • Of course, I am also able to display all maps it serves using the interface provided by pg_tileserv.
  • However, I am unable display the map using leaflet. Here is the code I am using:
leaflet() %>%
    leaflet::addTiles(urlTemplate = "http://192.168.1.88:7808/ara.prk/{z}/{x}/{y}.pbf") %>%
    leaflet::setView(lng = -73.985130, lat = 40.758896, zoom = 11)

The code yields an empty page.

What am I doing wrong?
S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant