Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a custom tile layer #1020

Closed
cdqrain opened this issue Sep 26, 2012 · 2 comments

Comments

@cdqrain
Copy link

commented Sep 26, 2012

Hi, all

I have a tile map server, which has been extends tile layer successfully in ArcGIS API through set origin point, resolutions, spatialreference.

But in leaflet, it has not these parameters to be set.

@mourner

This comment has been minimized.

Copy link
Member

commented Oct 12, 2012

@mourner mourner closed this Oct 12, 2012

@cdqrain

This comment has been minimized.

Copy link
Author

commented Dec 21, 2012

Hi, mourner.

My code is like this:

var res = [0.010986328121328564, 0.0054931640725615878, 0.0027465820243834883, 0.0013732910240890493, 0.00068664551204452467, 0.00034332274412495725, 0.00017166138395978368, 8.5830680082586813e-005, 4.2915340041293407e-005, 2.1457670020646703e-005];

var crs = L.CRS.EPSG4326;

var scale = function (zoom) {
return 1 / res[zoom];
};

crs.scale = scale;
var map = new L.Map('map', {
crs: crs,
continuousWorld: true,
worldCopyJump: false
});

var mapUrl = "http://_._.com/Vector/wmts?services=wmts&version=1.0.0&request=gettile&layer=Vector&style=Vector&format=image/png" +
"&tilematrixset=matrix_0&tilematrix={z}&tilerow={y}&tilecol={x}";

var tilelayer = new L.TileLayer(mapUrl, {
tms: false
,maxZoom: res.length
,minZoom: 0
,continuousWorld: true
,attribution: attrib
});
map.addLayer(tilelayer);

But, It can not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.