tilewriter | simple JavaScript library that draws tile | Canvas library
kandi X-RAY | tilewriter Summary
kandi X-RAY | tilewriter Summary
This is a (very simple) JavaScript library that draws pictures (and text) formed by "tiles" using block elements (instead of, say, drawing over an HTML5 canvas). It was written mostly as a visual test, but may be useful for generating this kind of illustration dynamically on older browsers.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tilewriter
tilewriter Key Features
tilewriter Examples and Code Snippets
Community Discussions
Trending Discussions on tilewriter
QUESTION
I have made a map app for personal use, in which I can choose one of three map sources: OpenTopo, Mapnik or HikeBike. It is primarily intended for off-line use, and to that end I have downloaded a complete set of OpenTopo bitmap tiles (.png), covering the zoom levels 11 through 15 for the local areas that interest me the most. The Mapnik and HikeBike map modes, on the other hand, I only intend to use when on-line, mostly for tour planning, etc.
The OpenTopo tile archives are stored as .gemf files directly in /storage/extSdCard/osmdroid/ (which is the path returned by querying Configuration.getInstance().getOsmdroidBasePath().getAbsolutePath();
).
The problem I have now is the fact that the two "auxiliary" map modes (Mapnik and HikeBike) don't fully "respect" the tile sources that have been set for them to use, even if connected to the internet. Instead, whenever the locality and zoom levels required by the mapview are covered by the locally available OpenTopo tiles, Mapnik/HikeBike annoyingly prefer to display those tiles.
I have put map.setUseDataConnection(true)
in onCreate()
, which I hoped would make fetching (missing) tiles on-line the default, granted a network connection.
I would appreciate advice on (1) how to make the vector-based map modes discriminate between their own correct tiles and the OpenTopo static bitmaps, as expected. And (2) how to entice them to dynamically download any missing tiles if actually on-line.
Here are some potentially relevant snippets out of the 1100+ lines of code in my MapsActivity.java file:
...ANSWER
Answered 2019-Nov-10 at 13:56I solved this problem by firstly moving just the cached tiles from "/storage/extSdCard/osmodroid/tiles" to a new directory "/storage/extSdCard/osmXtra/tiles", then basically stripping out the guts of onCreate()
and putting it in a separate function onCreateCommonCode(String tileSourceName_X)
which takes the TileSource name as it's parameter.
This function now runs once on startup in onCreate()
with the default OpenTopoMaps as input, but also (with the appropriate TileSource-parameter) whenever the user commands a switch of map type. A simple "if TileSourceThis then TilePathThat" test selects the correct directory to search in for either archive files or the tile cache.
Perhaps not the most elegant solution, but apart for some minor oddities, like how mLocationOverlay.enableFollowLocation()
behaves after a map switch, I am satisfied with how it works now.
QUESTION
I am playing around with Osmdroid for use in an application. I already have a tiles server and want to use those tiles. Looked into docs used setTileSource(new XYTileSource())
magic happened. I have to mention that the documentation is a bit stale on many parts.
The tiles of the aforementioned server are already used in the app in a different feature. As logic dictates I want to use the same cache location so that I do not have duplicates of the tiles in the system. Again through docs, used Configuration.getInstance().setOsmdroidTileCase(new File("path"))
and again everything is going just fine. This was not so easy though as the documentation refers to the Osmdroids Constants class which is changed in the latest stable.
Then last part is to change from the SqlTileWriter
to a normal TileWriter
as we already have the image files downloaded from the other feature. This is where I cannot figure it out. I am using:
ANSWER
Answered 2018-Oct-29 at 08:00For anyone who might get stuck with this, I opened an issue in Osmdroid's Github page where we found and solved the issue. Take a look at this link for more info.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tilewriter
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page