All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.meteoinfo.data.mapdata.webmap.YahooMapInfo Maven / Gradle / Ivy

There is a newer version: 3.8
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.meteoinfo.data.mapdata.webmap;

/**
 *
 * @author yaqiang
 */
public class YahooMapInfo extends TileFactoryInfo {
    // 
    //private String version = "4.3";
    private String version = "2.1";
    // 
    // 

    /**
     * Constructor
     */
    public YahooMapInfo() {
//        super("YahooMap", 1, 17, 19,
//                256, true, true, // tile size is 256 and x/y orientation is normal
//                "http://maps%1$d.yimg.com/hx/tl?v=%2$s&.intl=%3$s&x=%4$d&y=%5$d&z=%6$d&r=1",
//                "x", "y", "z");
        super("YahooMap", 1, 17, 19,
                256, true, true, // tile size is 256 and x/y orientation is normal
                "https://%1$d.base.maps.api.here.com/maptile/%2$s/maptile/ef83a04284/normal.day/%3$d/%4$d/%5$d/256/png8?lg=ENG&token=%6$s&requestid=yahoo.prod&app_id=%7$s",
                "x", "y", "z");
        this.baseURL = "http://%1$d.base.maps.api.here.com/maptile/%2$s/maptile/newest/normal.day/%3$d/%4$d/%5$d/256/png8?lg=%6$s&token=%7$s&requestid=yahoo.prod&app_id=%8$s";
        this.setLanguage("EN");
    }
//    // 
//    // 
//    // 
//    // 

    @Override
    public String getTileUrl(int x, int y, int zoom) {
        zoom = this.getTotalMapZoom() - zoom;
        int serverNum = this.getServerNum(x, y, 2) + 1;
        //String url = String.format(this.baseURL, serverNum, version, this.getLanguage(), x, ((1 << zoom) >> 1) - 1 - y, zoom + 1);
        String rnd1 = "TrLJuXVK62IQk0vuXFzaig%3D%3D";
        String rnd2 = "eAdkWGYRoc4RfxVo0Z4B";
        String url = String.format(this.baseURL, serverNum, version, zoom, x, y, this.getLanguage(), rnd1, rnd2);
        return url;
    }
   
    // 
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy