Giter Site home page Giter Site logo

Comments (8)

msteiger avatar msteiger commented on July 17, 2024

Hello Lionel,
I do not know how google maps provides the tiles. Are you sure they are provided as 512px images?

In any case, why would you want that? Is there an advantage of using bigger tiles?

from jxmapviewer2.

lionelmazeyrat avatar lionelmazeyrat commented on July 17, 2024

Hello Martin,
you can get googlemaps tiles with :
https://maps.googleapis.com/maps/api/staticmap&center=[LAT],[LONG]&key=[MY_KEY]&maptype=roadmap&size=256x256
Free key can be obtained at :
https://developers.google.com/maps/documentation/static-maps/?hl=de
It works well with the getTileUrl function posted above.

But with size=512x512, it doesn't works, tiles displayed are not correct.

I need to use 512x512 (or 640x640) which are the large dimension provided by google for free.

On each tile google add a watermark on the bootom, so with larger tiles this watermark is less annoying for example if the map size if around 4 tiles.

from jxmapviewer2.

msteiger avatar msteiger commented on July 17, 2024

I can reproduce the problem. See the linked commit above. It looks like the tile rendering is correct.

The displayed images have overlapping content, so it's probably the computation of lat/lon values from the X and Y values that isn't correct for other tile sizes. Where did you get the formulas from?

from jxmapviewer2.

lionelmazeyrat avatar lionelmazeyrat commented on July 17, 2024

I found the formula here :
https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Tile_bounding_box
See Python - Tile numbers to lon./lat.

from jxmapviewer2.

lionelmazeyrat avatar lionelmazeyrat commented on July 17, 2024

Hello martin, have you found some times to add support for tiles largest than 256px ???
It will be very interesting to support lots of tiles prividers with request with center lat/long (google, tomtom, herewego, mapquest,....)

from jxmapviewer2.

msteiger avatar msteiger commented on July 17, 2024

I investigated a little and could not find any obvious error. If you have the time, it would be great if you could have a look yourself and open a PR for it.

from jxmapviewer2.

lionelmazeyrat avatar lionelmazeyrat commented on July 17, 2024

Thanks, I did not found where the tile size was involved or any obvious error...

from jxmapviewer2.

msteiger avatar msteiger commented on July 17, 2024

I found the error ... and more ... the Google Maps API aims at providing one single tile that covers the entire viewport. It therefore cuts off small bits of text reaching into the visible area. As a result the tiles are not really ... well .. tiling.

Is there anything OpenStreetMap does not cover? If so, you might want to try Nokia Here. The quality is impressive and it supports 512x512 tiles, too.

from jxmapviewer2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.