[Mapbender-dev] [Mapbender] #920: failed initialization of EPSG from address search
Mapbender
mapbender_dev at lists.osgeo.org
Mon Aug 5 09:31:34 PDT 2019
#920: failed initialization of EPSG from address search
----------------------+-------------------
Reporter: SvenLVGL | Owner: dev
Type: defect | Status: new
Priority: minor | Milestone:
Component: core | Version: 2.7.3
Keywords: |
----------------------+-------------------
== Describe the bug
The map viewer throws error messages and does not work as intended when
opened directly from the address search if it was not initialized before.
== To Reproduce
Steps to reproduce the behavior:
1. Close your browser.
2. Open your browser in a private window (no cache/cookies/etc.)
3. Go directly to the address search, without opening the map viewer
before
4. Search a valid address and open the resulting link to view it on the
mal
5. See error similar to the attached screenshots.
== Expected behavior
The map viewer should zoom to the addresses location on the map and
display a dot to indicate the location.
== Screenshots
...
== Desktop
Has been tested with
- Google Chrome
- Mozilla Firefox
- Microsoft Internet Explorer
- Microsoft Edge
== Additional context
The fix seems to be found already. The issue is in the file
**mapbender/http/javascripts/initWmcObj.php**.
The following line seems to produce the problem, if the ''epsg'' has not
been initialized in this session before.
{{{#!php
$currentEpsg = Mapbender::session()->get("epsg");
}}}
The solution could look like this:
{{{#!php
$currentEpsg = Mapbender::session()->get("epsg");
if (!$currentEpsg) {
$currentEpsg = $DEFAULT_EPSG;
}
}}}
With `DEFAULT_EPSG` being defined in a configuration file that's included.
--
Ticket URL: <https://trac.osgeo.org/mapbender/ticket/920>
Mapbender <http://www.mapbender.org/>
Mapbender
More information about the Mapbender_dev
mailing list