custom map tile server supports annotation layer
This commit is contained in:
@@ -58,7 +58,7 @@ func (p *MapImageProxy) MapTileImageProxyHandler(c *core.Context) (*httputil.Rev
|
||||
} else if mapProvider == settings.TianDiTuProvider {
|
||||
return tianDiTuMapTileImageUrlFormat + "&tk=" + settings.Container.Current.TianDiTuAPIKey, nil
|
||||
} else if mapProvider == settings.CustomProvider {
|
||||
return settings.Container.Current.CustomMapTileServerUrl, nil
|
||||
return settings.Container.Current.CustomMapTileServerTileLayerUrl, nil
|
||||
}
|
||||
|
||||
return "", errs.ErrParameterInvalid
|
||||
@@ -70,6 +70,8 @@ func (p *MapImageProxy) MapAnnotationImageProxyHandler(c *core.Context) (*httput
|
||||
return p.mapImageProxyHandler(c, func(c *core.Context, mapProvider string) (string, *errs.Error) {
|
||||
if mapProvider == settings.TianDiTuProvider {
|
||||
return tianDiTuMapAnnotationUrlFormat + "&tk=" + settings.Container.Current.TianDiTuAPIKey, nil
|
||||
} else if mapProvider == settings.CustomProvider {
|
||||
return settings.Container.Current.CustomMapTileServerAnnotationLayerUrl, nil
|
||||
}
|
||||
|
||||
return "", errs.ErrParameterInvalid
|
||||
|
||||
@@ -40,7 +40,15 @@ func ServerSettingsCookie(config *settings.Config) core.MiddlewareHandlerFunc {
|
||||
settingsArr = append(settingsArr, buildStringSetting("cmzl", fmt.Sprintf("%d-%d-%d", config.CustomMapTileServerMinZoomLevel, config.CustomMapTileServerMaxZoomLevel, config.CustomMapTileServerDefaultZoomLevel)))
|
||||
|
||||
if !config.EnableMapDataFetchProxy {
|
||||
settingsArr = append(settingsArr, buildEncodedStringSetting("cmsu", config.CustomMapTileServerUrl))
|
||||
settingsArr = append(settingsArr, buildEncodedStringSetting("cmsu", config.CustomMapTileServerTileLayerUrl))
|
||||
|
||||
if config.CustomMapTileServerAnnotationLayerUrl != "" {
|
||||
settingsArr = append(settingsArr, buildEncodedStringSetting("cmau", config.CustomMapTileServerAnnotationLayerUrl))
|
||||
}
|
||||
} else {
|
||||
if config.CustomMapTileServerAnnotationLayerUrl != "" {
|
||||
settingsArr = append(settingsArr, buildBooleanSetting("cmap", config.EnableMapDataFetchProxy))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+18
-16
@@ -240,21 +240,22 @@ type Config struct {
|
||||
EnableDataExport bool
|
||||
|
||||
// Map
|
||||
MapProvider string
|
||||
EnableMapDataFetchProxy bool
|
||||
MapProxy string
|
||||
TomTomMapAPIKey string
|
||||
TianDiTuAPIKey string
|
||||
GoogleMapAPIKey string
|
||||
BaiduMapAK string
|
||||
AmapApplicationKey string
|
||||
AmapSecurityVerificationMethod string
|
||||
AmapApplicationSecret string
|
||||
AmapApiExternalProxyUrl string
|
||||
CustomMapTileServerUrl string
|
||||
CustomMapTileServerMinZoomLevel uint8
|
||||
CustomMapTileServerMaxZoomLevel uint8
|
||||
CustomMapTileServerDefaultZoomLevel uint8
|
||||
MapProvider string
|
||||
EnableMapDataFetchProxy bool
|
||||
MapProxy string
|
||||
TomTomMapAPIKey string
|
||||
TianDiTuAPIKey string
|
||||
GoogleMapAPIKey string
|
||||
BaiduMapAK string
|
||||
AmapApplicationKey string
|
||||
AmapSecurityVerificationMethod string
|
||||
AmapApplicationSecret string
|
||||
AmapApiExternalProxyUrl string
|
||||
CustomMapTileServerTileLayerUrl string
|
||||
CustomMapTileServerAnnotationLayerUrl string
|
||||
CustomMapTileServerMinZoomLevel uint8
|
||||
CustomMapTileServerMaxZoomLevel uint8
|
||||
CustomMapTileServerDefaultZoomLevel uint8
|
||||
|
||||
// Exchange Rates
|
||||
ExchangeRatesDataSource string
|
||||
@@ -691,7 +692,8 @@ func loadMapConfiguration(config *Config, configFile *ini.File, sectionName stri
|
||||
config.AmapApplicationSecret = getConfigItemStringValue(configFile, sectionName, "amap_application_secret")
|
||||
config.AmapApiExternalProxyUrl = getConfigItemStringValue(configFile, sectionName, "amap_api_external_proxy_url")
|
||||
|
||||
config.CustomMapTileServerUrl = getConfigItemStringValue(configFile, sectionName, "custom_map_tile_server_url")
|
||||
config.CustomMapTileServerTileLayerUrl = getConfigItemStringValue(configFile, sectionName, "custom_map_tile_server_url")
|
||||
config.CustomMapTileServerAnnotationLayerUrl = getConfigItemStringValue(configFile, sectionName, "custom_map_tile_server_annotation_url")
|
||||
config.CustomMapTileServerMinZoomLevel = getConfigItemUint8Value(configFile, sectionName, "custom_map_tile_server_min_zoom_level", 1)
|
||||
config.CustomMapTileServerMaxZoomLevel = getConfigItemUint8Value(configFile, sectionName, "custom_map_tile_server_max_zoom_level", 18)
|
||||
config.CustomMapTileServerDefaultZoomLevel = getConfigItemUint8Value(configFile, sectionName, "custom_map_tile_server_default_zoom_level", 14)
|
||||
|
||||
Reference in New Issue
Block a user