单张单张图片 [英] Leaflet single picture
问题描述
我目前正在实习,他们要求我在Kibana Bettermap上使用停车地图"图片(.jpg). Bettermap正在使用Leaflet,我发现可以在其中更改图片链接:
I am currently doing an internship and they asked me to use a Parking map picture (.jpg) on Kibana bettermap. Bettermap is using Leaflet, and I found where I could change the picture link:
function e() {
b.css({
height : a.panel.height || a.row.height
}),
a.require(["./leaflet/plugins"], function () {
a.panelMeta.loading = !1,
d.Icon.Default.imagePath = "app/panels/bettermap/leaflet/images",
c.isUndefined(f) ? (f = d.map(a.$id, {
scrollWheelZoom : !1,
center : [40, -86],
zoom : 10
}), d.tileLayer("**http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg**", {
attribution : "Data, imagery and map information provided by MapQuest, OpenStreetMap <http://www.openstreetmap.org/copyright> and contributors, ODbL",
maxZoom : 18,
minZoom : 2
}).addTo(f), g = new d.MarkerClusterGroup({
maxClusterRadius : 30
})) : g.clearLayers();
var b = [];
c.each(a.data, function (a) {
b.push(c.isUndefined(a.tooltip) || "" === a.tooltip ? d.marker(a.coordinates) : d.marker(a.coordinates).bindLabel(c.isArray(a.tooltip) ? a.tooltip[0] : a.tooltip))
}),
g.addLayers(b),
g.addTo(f),
f.fitBounds(c.pluck(a.data, "coordinates"))
})
}
问题在于制作了Leaflet,因此您有很多图片制作了Tile.我想做的就是只使用一张图片,当我更改图片的路径时,我显然会得到一张只有一张图片的图块.
The problem is that Leaflet is made so you have a lot of pictures making a Tile. What I would like to do is to simply use one picture, and when I change the path to my picture I am obviously getting a Tile of my only one picture.
任何人都知道如何在Leaftlet上简单地使用一张本地图片?
Anyone got an idea on how I could simply use one local picture on Leaftlet ?
非常感谢.
推荐答案
使用L.ImageOverlay
.您可以查看一些小册子代码示例看看它是如何工作的.
Use a L.ImageOverlay
. You can check some of the Leaflet code examples to see how it works.
这篇关于单张单张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!