alfarisi / leaflet-deepzoom Goto Github PK
View Code? Open in Web Editor NEWDisplay DeepZoom tiles with Leaflet
Home Page: http://www.indokreatif.net
Display DeepZoom tiles with Leaflet
Home Page: http://www.indokreatif.net
Currently the url for xxx_files
is taken as source, I would recommend changing to take the XML file instead.
The DZI XML is easy to parse and we can get useful info from it:
Could you publish this leaflet plugin as an npm module?
I can't set the view of the map with L.LatLng
:
var map = L.map('map', {}).setView(new L.LatLng(0,0), 0);
Same with the markers, I can't create one. It's normal?
Thanks!
Ideally, if we are zooming out and we dont have image available in the tiling server,
I am having problems using maxNativeZoom and leaflet-deepzoom. I'm using the example supplied with leaflet-deepzoom and introducing maxNativeZoom.
Provided is the snippet of code that I have modifed:
var map = L.map('image2d', {
maxZoom:16
}).setView(new L.LatLng(0,0), 0);
map.setMaxBounds(new L.LatLngBounds(
map.unproject([-100, (Math.pow(2, map.getMaxZoom()) * 128) + 100], map.getMaxZoom()),
map.unproject([Math.pow(2, map.getMaxZoom()) * 256, -100], map.getMaxZoom())
));
var tileLayerOptions = {
width: 2400,
height: 3000,
tolerance: 0.8,
maxZoom:16,
maxNativeZoom:12
}
L.tileLayer.deepzoom('DeepZoomImage/hubble_files/', tileLayerOptions).addTo(map);
The issue is that tiles disappear after level 13. I've tried various suggestions for the same issue that others not using leaflet-deepzoom have had with no luck.
The lines 'map.unproject()' inside the initialize() method assumes 'map' exists in global scope. It'd be really cool to pass in a reference to the map as an option (unless there is a better way to access the map) and if that option exists use that instead.
e.g. "const map = options.map || map; " before 'map' is used to call unproject( that way if a map is passed it it'll use that otherwise fallback to global scope.
Otherwise it's a bit awkward to render multiple on a page. Though i'm doing this for a demo so it probably doesn't matter that much.
Really cool plugin :)
Hi, I use vue.js to implement the library. But when i use it in the template, i get an exception.
vue.runtime.esm.js?2b0e:1888 ReferenceError: map is not defined
at NewClass.initialize (leaflet-deepzoom.js?94c2:47)
at new NewClass (leaflet-src.js?e11e:301)
at Function.L.tileLayer.deepzoom (leaflet-deepzoom.js?94c2:103)
at VueComponent.mounted (Home.vue?76f2:19)
at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
at callHook (vue.runtime.esm.js?2b0e:4213)
at Object.insert (vue.runtime.esm.js?2b0e:3139)
at invokeInsertHook (vue.runtime.esm.js?2b0e:6340)
at Vue.patch [as __patch__] (vue.runtime.esm.js?2b0e:6559)
at Vue._update (vue.runtime.esm.js?2b0e:3939)
My code is here. Do i have any wrong action.
<template>
<div id="mapid"></div>
</template>
<script>
import L from 'leaflet'
import 'leaflet-deepzoom'
export default {
data () {
return {}
},
mounted () {
var map = L.map('mapid').setView(new L.LatLng(0,0), 0);
var dzLayer = L.tileLayer.deepzoom('DeepZoomImage/hubble_files/', {
width: 2400,
height: 3000
}).addTo(map)
map.fitBounds(dzLayer.options.bounds)
}
}
</script>
<style>
#mapid {
height: 512px;
}
</style>
Thank you for a VERY useful plugin for Leaflet!
I'm using it in a cultural project in which we display old maps and drawings.
In some cases, there are one pixel of space between tiles, showing as vertical and horizontal lines dividing the images.
An example can be seen here: http://www.politietsregisterblade.dk/kildeviser/version3/#?collection=3&item=2479
The tiles are created using MapTiler, default settings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.