Giter Site home page Giter Site logo

Comments (4)

ghettovoice avatar ghettovoice commented on July 25, 2024

Hi @sonalanshika,
from snapshots that you send me I see that something wrong with raster reprojection.
Try to set 'EPSG:4326' projection to the XYZ source or map view.

const map = new ol.Map({
  ...
  view: new ol.View({
    projection: 'EPSG:4326',
  })
})

// and for the tile source cause by default it use EPSG:3857
var maplayer = new ol.layer.Tile({
  source: new ol.source.XYZ({
    projection: 'EPSG:4326',
    tileUrlFunction: createTileUrlFunction('https://URL_To_Tilecache/{0z}/{x1}/{x2}/{x3}/{-y1}/{-y2}/{-y3}.jpeg',tileGrid,map_extent)
  })
});

from ol-tilecache.

sonalanshika avatar sonalanshika commented on July 25, 2024

Hi,

Thank you. however it solved the problem only partially. It is not showing the complete extent still. My code-snippet is below. Please suggest further.

var projection = ol.proj.get('EPSG:4326');

var map_extent=projection.getExtent();;
var origin = ol.extent.getTopLeft(projection.getExtent());

var maplayer = new ol.layer.Tile({
source: new ol.source.XYZ({
tileUrlFunction: createTileUrlFunction('https://URL_To_Tilecache/{0z}/{x1}/{x2}/{x3}/{-y1}/{-y2}/{-y3}.jpeg',tileGrid,map_extent),
projection: projection
})
});

var mapview = new ol.View({
center: [78.0000 , 21.0000 ],
projection: 'EPSG:4326',
resolutions: resolution_map,
zoom: 0,
minZoom: 0,
maxZoom: 17
});

map = new ol.Map({
target: 'map',
projection: 'EPSG:4326',
layers: [maplayer ],
view: mapview
});

from ol-tilecache.

ghettovoice avatar ghettovoice commented on July 25, 2024

Hmm, still looks like a problem with view configuration or resolutions.

Try initialize view like below

var mapview = new ol.View({
  center: [78.0000 , 21.0000 ],
  projection: 'EPSG:4326', 
  zoom: 0,
  maxZoom: 17,
});

And tile grid

var tileGrid = ol.tilegrid.createXYZ({
  extent: ol.proj.get('EPSG:4326').getExtent(),
  maxZoom: 17,
  tileSize: [256, 256],
});

And also try to create source with you custom grid

const source = new ol.source.XYZ({
  tileUrlFunction: createTileUrlFunction('https://URL_To_Tilecache/{0z}/{x1}/{x2}/{x3}/{-y1}/{-y2}/{-y3}.jpeg',tileGrid,map_extent),
  projection: projection, 
  tileGrid: tileGrid,
})

Are you tiles data public? So I can play around this options too

from ol-tilecache.

sonalanshika avatar sonalanshika commented on July 25, 2024

Hi,
thanks It works now. By adding tileGrid: tileGrid to the ol.source.XYZ. while tilegrid is kept "ol.tilegrid.TileGrid...." only.

Thank Again.

Regards,
Sonal

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.