Closed JerckyLY closed 7 months ago
Hi liuyang,
this value could also be incorrect (or at least for your use case):
var size = this._map.getSize();
I recommend you explore the L.Map
class (both in the core repository and here) to find the function that might be right for you:
PS: if you need dev support, try asking on stackoverflow.com too..
👋 Raruto
Hi @Raruto
map.setBearing(0)
it will query wms normally, but when I setBeaing(angle > 0)
it will not query normally, in both cases. The value of getSize()
is the same.Thanks in a lot
the code:
var containerPoint = this._map.latLngToContainerPoint(latlng);
// get unRotate point
var angle = this._map.getBearing() * L.DomUtil.DEG_TO_RAD; //
var center = this._map._getPixelCenter();
var point = containerPoint.rotateFrom(-angle, center);
var size = this._map.getSize(),
params = {
request: "GetFeatureInfo",
service: "WMS",
srs: "EPSG:4326",
styles: this.wmsParams.styles,
transparent: this.wmsParams.transparent,
version: this.wmsParams.version,
format: this.wmsParams.format,
bbox: this._map.getBounds().toBBoxString(),
// bbox,
height: size.y,
width: size.x,
layers: layers,
query_layers: layers,
info_format: "application/json",
}
params[params.version === "1.3.0" ? "i" : "x"] = parseInt(point.x)
params[params.version === "1.3.0" ? "j" : "y"] = parseInt(point.y)
I don't know what to do anymore, can you give me an idea?
Honestly?
Your code also depends on:
this._map.getBounds()
which could cause further problems, but really, it depends on your goal/context.
Frankly, this repo contains difficult notions (unless is your daily job..), I'm not going to get into the code just because you ask..
👋 Raruto
@Raruto Thanks for the reply, I'll look into it myself again, thanks in a lot
Thanks in a lot
get wms info code: