- $t = get_markup_template("admin.tpl", "addon/openstreetmap/");
- $tmsserver = Config::get('openstreetmap', 'tmsserver');
- if(! $tmsserver) {
- $tmsserver = 'http://www.openstreetmap.org';
- }
- $nomserver = Config::get('openstreetmap', 'nomserver');
- if(! $nomserver) {
- $nomserver = 'http://nominatim.openstreetmap.org/search.php';
- }
- $zoom = Config::get('openstreetmap', 'zoom');
- if(! $zoom) {
- $zoom = 16;
- }
- $marker = Config::get('openstreetmap', 'marker');
- if(! $marker) {
- $marker = 0;
- }
-
- $o = replace_macros($t, [
- '$submit' => t('Submit'),
- '$tmsserver' => ['tmsserver', t('Tile Server URL'), $tmsserver, t('A list of <a href="http://wiki.openstreetmap.org/wiki/TMS" target="_blank">public tile servers</a>')],
- '$nomserver' => ['nomserver', t('Nominatim (reverse geocoding) Server URL'), $nomserver, t('A list of <a href="http://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Nominatim servers</a>')],
- '$zoom' => ['zoom', t('Default zoom'), $zoom, t('The default zoom level. (1:world, 18:highest, also depends on tile server)')],
- '$marker' => ['marker', t('Include marker on map'), $marker, t('Include a marker on the map.')],
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/openstreetmap/");
+ $tmsserver = DI::config()->get('openstreetmap', 'tmsserver', OSM_TMS);
+ $nomserver = DI::config()->get('openstreetmap', 'nomserver', OSM_NOM);
+ $zoom = DI::config()->get('openstreetmap', 'zoom', OSM_ZOOM);
+ $marker = DI::config()->get('openstreetmap', 'marker', OSM_MARKER);
+
+ // This is needed since we stored an empty string in the config in previous versions
+ if (empty($nomserver)) {
+ $nomserver = OSM_NOM;
+ }
+
+ $o = Renderer::replaceMacros($t, [
+ '$submit' => DI::l10n()->t('Submit'),
+ '$tmsserver' => ['tmsserver', DI::l10n()->t('Tile Server URL'), $tmsserver, DI::l10n()->t('A list of <a href="http://wiki.openstreetmap.org/wiki/TMS" target="_blank">public tile servers</a>')],
+ '$nomserver' => ['nomserver', DI::l10n()->t('Nominatim (reverse geocoding) Server URL'), $nomserver, DI::l10n()->t('A list of <a href="http://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Nominatim servers</a>')],
+ '$zoom' => ['zoom', DI::l10n()->t('Default zoom'), $zoom, DI::l10n()->t('The default zoom level. (1:world, 18:highest, also depends on tile server)')],
+ '$marker' => ['marker', DI::l10n()->t('Include marker on map'), $marker, DI::l10n()->t('Include a marker on the map.')],