Comments (4)
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.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ol-tilecache.