osmdroid - how to download tiles for offline use? - download

My app tries to download tiles for offline use like this:
for (MapTile mapTile : tileSet) {
mapView.getTileProvider().getMapTile(mapTile);
}
However, only a small part of the tileSet is actually downloaded.
How can I download all tiles contained in the tileSet at once?

Related

Siebel open UI IP16 - loading image customization

Is there a way I can customize (replace with another GIF image) the loading image in Siebel Open UI in IP16 version? The current loading image is an red colored, oval shaped, oracle provided one, but i do not find the corresponding image in images folder. Any leads?
The animated icon may be stored in css files.
Try to search in your css files for something like
.siebui-mask-outer
timer
It may not be an actual gif but an css transformation.
(btw. You can run your Chrome Developer tool and examine the source of the icon)
The standard GIF file must be in public/enu folder (for english application) on the web server. On your local installation, it will be in C:\Siebel81\16.0.0.0.0\Client\PUBLIC\IMAGES\
There are multiple gif files there used for different applications.

Adding a .xcassets file to an Xcode framework project

I've got a framework project that uses a number of images. As it stands I just drag these images into the project so that they sit alongside my source files:
When I embed this project into a separate app project, I can access these resources as expected.
Ideally, I'd now like to organize my framework images with a .xcassets file. Unlike app projects, the framework project template doesn't provide one of these by default, so I've added one manually using the File > New menu. Unfortunately when I rebuild the framework and re-embed it, I can no longer access the images. Is what I'm trying to do possible?
If you want to access assets in a subproject (framework etc.) you need to make sure that you are collecting them from their own bundle since they are not part of the Main Bundle.
You can do that simply with this Swift 4 code:
let bundle = Bundle(for: type(of: self))
let image = UIImage(named: "imageName", in: bundle, compatibleWith: nil)
From what I can make out, the answer to my question is yes, sort of...
To make use of the NSImage(named: ...) API one of two things needs to be true: either the image should exist within the app's main bundle, or (to paraphrase the docs):
[there should be] an [NSImage] object whose name was set explicitly using the setName: method and currently resides in the image cache.
In the case where the image resides in an embedded framework, the first isn't true since the framework is a separate bundle, and there's no way of adding to the main bundle at runtime. This leaves the second approach.
Whenever your code is going to use NSImage(named: ...) make sure you've already loaded the image using some other way, then set its name:
let bundle = NSBundle(forClass: MyFrameworkClass.self)
let image = bundle.imageForResource(name) // image in the framework .xcassets
image.setName(name)
I don't know how much use this is, and you should definitely be aware of the notes in the docs about how the image cache operates, but it is at least one way of storing images in a .xcassets folder in one bundle, then accessing them from another.

How to control the size of the downloaded map area for each zoom level in OSMDroid?

I'm using offline maps downloaded from OpenStreetMaps on my Android application.
When I move the map some tiles do not appears.
I whould like to choose the area of n kilometers by m kilometers or something else.
You are curently just getting the tiles osmdroid has in it's cache. It caches tiles automaticaly as it downloads the. There is no easy way of getting tiles into the cache without first trying to display them with online enabled.
If you realy want offline support you have to prepare a file with the tiles you need and get it into the sdcard/osmdroid/ direcrctory. The simplest method of creating the file is to use a tool like Mobile Atlas Creator I would recomend the GEMF format over .zip it just works far better procedure is the same just copy the file and it is found automaticaly.

How to render uploaded photos with NodeJS and Express?

I generally post examples of my best shot at what I'm asking about, but in this case, I have no idea where to start (haven't uploaded photos before in other languages).
So how does one go about rendering uploaded photos. I'm using Node v0.4.2, Express 1.0.8, and Mongoose 1.0.16 and have uploading of images working (they end up in ~/tmp right now).
Thanks.
If you just want to render thumbnail versions of your uploaded images for display, try using the imagemagick wrapper node-imagemagick.
For example, you could store your hires-images in a data-folder on your server (lets say /data/images) and render thumbnail images into a web-accessible folder (on upload).
I do not recommend generating the thumbnails on the fly, as it can massively increase your server's load when a large image (especially vector formats like eps or pdf) is being rendered.
For imagemagick examples, consider reading up the docs for the convert command.

Images showing up that shouldn't in iPad application

I have an iPad application which has many categorized images I need to switch between.
I store the categories in a database, along with the image prefix and number of images for that category. Using a random number in the range of 0-to-image_count_for_category, I get an image name like this:
[image_prefix][random_number].png => "SomeCategory3.jpg"
The images themselves are included in the project file structure and are not stored in the database.
All the image swapping is going fine. The problem lies in some of the image usage... I used to have an image "SomeCategory3.jpg", which was in the application, and has been displayed. Now, I replace the image named SomeCategory3.jpg, and the old image shows up ... Um ... how is that possible?
I have tried removing the app from the device, cleaning the project, re-building, and re-copying to the device for debug. Still, the old image comes up in that random rotation.
My app never copy the images anywhere. I simply reference them using the app folder with the image name appended.
I have verified that the old images are not in the folder or referenced by the project. I have viewed all the images in xcode to ensure the image displays properly.
Yet somehow ... the old image gets used in my random image swapping rotation.
It's driving me mad trying to figure out how the old image is there.
Any ideas?
Thanks!
Kevin
Xcode can't tell the image changed and did not overwrite the one in your app bundle's Resources folder. Right-click the image in your Xcode project and click "Touch" then rebuild. That or clean your target and rebuild.

Resources