Giter Site home page Giter Site logo

leaflet-deepzoom's People

Contributors

alfarisi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

leaflet-deepzoom's Issues

Take XML as source

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:

  • width
  • height
  • image format
  • overlap

Set the view of the map and add a marker

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!

For the cases where url zoom is below 0, the deep zoom should be serving the image last loaded from tile server at url zoom 0

Ideally, if we are zooming out and we dont have image available in the tiling server,

  • we should be able to use the last rendered tile image and just resize it to the lower zoom
  • As it is zoom out , we dont have to worry about the image resolutions, as we already have one with better resolution at higher zoom
  • I have also tried with setting minNativeZoom and minZoom and even that doesnt work.
  • leaflet deepzoom is not able to handle this scenario, it throws error in console saying x of undefined and then error is shown in the map.

using maxNativeZoom with leaflet-deepzoom

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.

pass map reference into options

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 :)

ReferenceError: map is not defined

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>

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.