Giter Site home page Giter Site logo

Comments (4)

ghettovoice avatar ghettovoice commented on July 25, 2024

Hi, it's difficult to say without seeing code.
can you give some example of your code of use case?

from ol-tilecache.

cchandel avatar cchandel commented on July 25, 2024

Hi,
Code is as below.

ol3

var map = new ol.Map({
  target: 'map',
  layers: [
  new ol.layer.Tile({
      source: new ol.source.XYZ({
        tileUrlFunction: ol.TileCacheUrlFunction.createTileUrlFunction( '//localhost/tiles/landmass/{0z}/{x1}/{x2}/{x3}/{-y1}/{-y2}/{-y3}.png')
      })
    })
  ],

  view: new ol.View({
    projection: 'EPSG:4326',
    center: [72.8, 18.8],
    zoom: 6
  }),
})

ol2 code
var globe = new OpenLayers.Layer.TileCache( "Landmass", "../tiles", "landmass", {isBaseLayer: true});
  map = new OpenLayers.Map('map', {
    maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
    resolutions: [0.158739, 0.063495, 0.031747, 0.015873, 0.006349, 0.003174, 0.001587, 0.000634, 0.000317, 0.000158, 0.000158, 0.000063, 0.000031]
  });
  map.addLayers([globe]);
  map.setCenter(new OpenLayers.LonLat(72.8, 18.8), 6);

from ol-tilecache.

ghettovoice avatar ghettovoice commented on July 25, 2024

this extension doesn't reproject coordinates, it uses tile coordinates calculated by ol3 bassed on current projection and tile grid params.
so, i think, your should use custom tile grid object with your resolutions, tileSize and etc.
http://openlayers.org/en/v3.12.1/apidoc/ol.tilegrid.TileGrid.html
and set EPSG:4326 projection on the layer source.

I will try to look into this matter more deeply later.

from ol-tilecache.

ghettovoice avatar ghettovoice commented on July 25, 2024

also you need to setup correct origin of your custom tileGrid to get correct X and Y in tileCoord
more info

So I close this issue because ol3-tilecache extension isn't responsible for the creation correct tile grid.
Reopen if you have questions
Thanks

from ol-tilecache.

Related Issues (6)

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.