Code Monkey home page Code Monkey logo

Comments (15)

LRP-sgravel avatar LRP-sgravel commented on June 18, 2024

I'm getting a similar result in the Http demo. Tiles do not align (and load extremely slowly)

image

from tileview.

moagrius avatar moagrius commented on June 18, 2024

Can you post your project somewhere I can view it?

from tileview.

LRP-sgravel avatar LRP-sgravel commented on June 18, 2024

Unfortunately, no. First, it is a Xamarin project with bindings I created. Second, it's an extremely large customer's project that includes iOS, WPF and a web back and front end...

from tileview.

moagrius avatar moagrius commented on June 18, 2024

Have you tried previous stable, 2.7 something?

from tileview.

LRP-sgravel avatar LRP-sgravel commented on June 18, 2024

Not yet, let me try to add a demo activity that uses our tiles URL and see how it behaves.

from tileview.

LRP-sgravel avatar LRP-sgravel commented on June 18, 2024

Alright, so I'm getting the same result in teh demo using this activity :


import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.moagrius.tileview.Tile;
import com.moagrius.tileview.TileView;
import com.moagrius.tileview.io.StreamProviderHttp;
import com.moagrius.tileview.plugins.LowFidelityBackgroundPlugin;

public class TileViewDemoSmartUse extends TileViewDemoActivity implements TileView.TileDecodeErrorListener {

  private TileView mTileView;

  @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_demos_tileview);
    frameToCenterOnReady();
    mTileView = findViewById(R.id.tileview);
    mTileView.setTileDecodeErrorListener(this);
    mTileView.setMinimumScale(0.25f);
    mTileView.setMaximumScale(2.5f);
    new TileView.Builder(mTileView)
        .setSize(3456, 2592)
        .setStreamProvider(new StreamProviderHttp())
        .setDiskCachePolicy(TileView.DiskCachePolicy.CACHE_ALL)
        .defineZoomLevel("https://smartusev5canadaeast.blob.core.windows.net/content-a6c5a7a4-902f-4f73-bf9a-b53044f6e5e1/3d2481d0-1b84-43d7-865e-1d732770c4cd/200/tile_001_%1$03d_%2$03d.png?sv=2017-07-29&sr=c&sig=BUOF9sn%%2BeCQNLlRkg%%2FghdntzwMvP3hjQ1CrMBccT%%2FZ8%%3D&se=2019-06-08T15:06:01Z&sp=r")
        .build();
  }

  @Override
  public void onTileDecodeError(Tile tile, Exception e) {
    mTileView.retryTileDecode(tile);
  }

}

from tileview.

moagrius avatar moagrius commented on June 18, 2024

I'll give it a shot tonight or tomorrow

from tileview.

moagrius avatar moagrius commented on June 18, 2024

I ran it briefly when a I had a down minute at work. Since you're URLs are HTTPS (rather than HTTP), you probably want tochange line 16 of StreamProviderHttps to HttpURLConnection connection = (HttpURLConnection) url.openConnection();

That gave me decent results, but with the latency of a network with our aggressive caching, network is a weak spot right now.

I'd suggest either:

  1. User the stable version 2 build. it's here as https://github.com/moagrius/TileView/tree/version-2.7.7 (which is actually a typo, it should be 2.2.7), as implement com.qozix:tileview:2.2.7, or i think you can grab it all the way up to patch 9 with the old namespace: implement com.qozix:tileview:2.2.9. The API is slightly different but that lived in the wild for several years and is pretty mature. This version is not as optimized for a single tile tile - if you have multiple scales (say 0.5, and 0.25) you should probably create those sets and pass them to the TileView.

or...

  1. if you're always using the same set of tiles, i'd download them all upfront and keep them on disk, and use internal or external stream providers, or even a custom one from the cache dir if you don't want them to persist between installs. It won't actually use any more space since you're using disk cache anyway. This will give you much faster and more reliable local read and decode.

I do plan on returning to the remote images bug (I believe there's still an open issue), but it's probably going to be a month before I can put serious time into this project again.

LMK what you decide, and good luck.

from tileview.

LRP-sgravel avatar LRP-sgravel commented on June 18, 2024

Version 2.2.9 is even worse. I can't even get the document to properly layout at any zoom level. The tiles flash all over the place, panning and zooming swaps the tiles around. This library simply doesn't appear to work for our very simple scenario. Not sure how this is possible given the history of your library.

from tileview.

LRP-sgravel avatar LRP-sgravel commented on June 18, 2024

image

Then I pan and look at the top, new tiles have loaded...

image

from tileview.

moagrius avatar moagrius commented on June 18, 2024

from tileview.

LRP-sgravel avatar LRP-sgravel commented on June 18, 2024

I could try, I just don't see how it's related. Your engine doesn't know if the input stream / bitmap comes from the web or not and it lays out images seemingly randomly. Changing the location of the data doesn'T appear to have anything to do with the issue.

from tileview.

moagrius avatar moagrius commented on June 18, 2024

from tileview.

LRP-sgravel avatar LRP-sgravel commented on June 18, 2024

No worries, I know what lacking the time to do all those great projects feels like. The link I provided will have expired by the time you get to looking into it as it is session bound. Hopefully you ca reproduce some other way.

I'm not comfortable using a library with what definitely looks like a race condition into a production software.

from tileview.

moagrius avatar moagrius commented on June 18, 2024

Totally understandable, and good luck with your project!

Just for documentary purposes, and future readers, this bug only applies to remote tiles (tile image files on a web server, fetched over http or something similar).

And a final note to self: this could also be a disk caching issue.

from tileview.

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.