comparison client/src/store/map.js @ 3256:48801e13ef18

client: identify: made identification of image layers work with current map resolution instead of a fixed value of 100 which lead to unexpected results
author Markus Kottlaender <markus@intevation.de>
date Tue, 14 May 2019 18:51:16 +0200
parents ba7bc3740fb3
children 985bc5009115
comparison
equal deleted inserted replaced
3255:ccd1f03ed18a 3256:48801e13ef18
393 } 393 }
394 } 394 }
395 } 395 }
396 */ 396 */
397 397
398 let currentResolution = map.getView().getResolution();
399
398 var waterwayAxisSource = map.getLayer("WATERWAYAXIS").getSource(); 400 var waterwayAxisSource = map.getLayer("WATERWAYAXIS").getSource();
399 var waxisUrl = waterwayAxisSource.getGetFeatureInfoUrl( 401 var waxisUrl = waterwayAxisSource.getGetFeatureInfoUrl(
400 event.coordinate, 402 event.coordinate,
401 100 /* resolution */, 403 currentResolution /* resolution */,
402 "EPSG:3857", 404 "EPSG:3857",
403 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d 405 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d
404 { INFO_FORMAT: "application/json" } 406 { INFO_FORMAT: "application/json" }
405 ); 407 );
406 408
423 }); 425 });
424 } 426 }
425 var waterwayAreaSource = map.getLayer("WATERWAYAREA").getSource(); 427 var waterwayAreaSource = map.getLayer("WATERWAYAREA").getSource();
426 var wareaUrl = waterwayAreaSource.getGetFeatureInfoUrl( 428 var wareaUrl = waterwayAreaSource.getGetFeatureInfoUrl(
427 event.coordinate, 429 event.coordinate,
428 100 /* resolution */, 430 currentResolution /* resolution */,
429 "EPSG:3857", 431 "EPSG:3857",
430 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d 432 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d
431 { INFO_FORMAT: "application/json" } 433 { INFO_FORMAT: "application/json" }
432 ); 434 );
433 435
449 }); 451 });
450 } 452 }
451 var dmSource = map.getLayer("DISTANCEMARKS").getSource(); 453 var dmSource = map.getLayer("DISTANCEMARKS").getSource();
452 var dmUrl = dmSource.getGetFeatureInfoUrl( 454 var dmUrl = dmSource.getGetFeatureInfoUrl(
453 event.coordinate, 455 event.coordinate,
454 100 /* resolution */, 456 currentResolution /* resolution */,
455 "EPSG:3857", 457 "EPSG:3857",
456 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d 458 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d
457 { INFO_FORMAT: "application/json" } 459 { INFO_FORMAT: "application/json" }
458 ); 460 );
459 461
475 }); 477 });
476 } 478 }
477 var dmaSource = map.getLayer("DISTANCEMARKSAXIS").getSource(); 479 var dmaSource = map.getLayer("DISTANCEMARKSAXIS").getSource();
478 var dmaUrl = dmaSource.getGetFeatureInfoUrl( 480 var dmaUrl = dmaSource.getGetFeatureInfoUrl(
479 event.coordinate, 481 event.coordinate,
480 100 /* resolution */, 482 currentResolution /* resolution */,
481 "EPSG:3857", 483 "EPSG:3857",
482 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d 484 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d
483 { INFO_FORMAT: "application/json" } 485 { INFO_FORMAT: "application/json" }
484 ); 486 );
485 487
502 } 504 }
503 // trying the GetFeatureInfo way for WMS 505 // trying the GetFeatureInfo way for WMS
504 var iecdisSource = map.getLayer("INLANDECDIS").getSource(); 506 var iecdisSource = map.getLayer("INLANDECDIS").getSource();
505 var iecdisUrl = iecdisSource.getGetFeatureInfoUrl( 507 var iecdisUrl = iecdisSource.getGetFeatureInfoUrl(
506 event.coordinate, 508 event.coordinate,
507 100 /* resolution */, 509 currentResolution /* resolution */,
508 "EPSG:3857", 510 "EPSG:3857",
509 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d 511 // { INFO_FORMAT: "application/vnd.ogc.gml" } // not allowed by d4d
510 { INFO_FORMAT: "text/plain" } 512 { INFO_FORMAT: "text/plain" }
511 ); 513 );
512 514