package tech.zafrani.pubgapp.maps;

import com.google.android.gms.maps.model.UrlTileProvider;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Locale;

public class PUBGTileProvider extends UrlTileProvider {
    private final String format = "https://raw.githubusercontent.com/Zsteven44/PUBG-Companion/master/app/src/main/assets/map/%d_%d_%d.png";

    public PUBGTileProvider() {
        super(256, 256);
    }

    @Override
    public URL getTileUrl(final int x,
                          final int y,
                          final int zoom) {
        try {
            return new URL(String.format(Locale.getDefault(), format, zoom, x, y));
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        return null;
    }

  /*  @Override
    public Tile getTile(final int x,
                        final int y,
                        final int zoom) {
        try {
            return new Tile(256, 256, FileUtil.getBytesForFile(context, "map/" + zoom + "_" + x + "_" + y + ".png"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }*/
}


@@ -29,16 +29,60 @@
 .maps;%0A%0A
+import android.support.annotation.NonNull;%0A%0A
 import c
@@ -131,16 +131,16 @@
 ovider;%0A
-
 %0Aimport 
@@ -273,16 +273,30 @@
 ovider %7B
+%0A%0A    @NonNull
 %0A    pri
@@ -300,16 +300,23 @@
 private 
+static 
 final St
@@ -320,22 +320,31 @@
  String 
-format
+TILE_URL_FORMAT
  = %22http
@@ -392,44 +392,20 @@
 UBG-
-Companion/master/app/src/main/assets
+Tiles/master
 /map
@@ -697,22 +697,31 @@
 ault(), 
-format
+TILE_URL_FORMAT
 , zoom, 
@@ -847,377 +847,7 @@
  %7D%0A%0A
-  /*  @Override%0A    public Tile getTile(final int x,%0A                        final int y,%0A                        final int zoom) %7B%0A        try %7B%0A            return new Tile(256, 256, FileUtil.getBytesForFile(context, %22map/%22 + zoom + %22_%22 + x + %22_%22 + y + %22.png%22));%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        return null;%0A    %7D*/%0A
 %7D%0A%0A

clean up