@@ -16,7 +16,7 @@ interface Props {
16
16
const BUILTIN_TEMPLATES = {
17
17
openstreetmap : {
18
18
name : "OpenStreetMap" ,
19
- url : "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png " ,
19
+ url : "" ,
20
20
wiki : "https://wiki.openstreetmap.org/wiki/Tiles" ,
21
21
requiresToken : false ,
22
22
} ,
@@ -65,12 +65,10 @@ const MapTileLayerProviderSelect = (props: Props) => {
65
65
} ;
66
66
67
67
const handleCustomUrlSubmit = ( ) => {
68
- if ( customUrl . trim ( ) ) {
69
- onValueChange ( customUrl . trim ( ) ) ;
70
- setIsCustomDialogOpen ( false ) ;
71
- setCustomUrl ( "" ) ;
72
- setSelectedTemplate ( "" ) ;
73
- }
68
+ onValueChange ( customUrl . trim ( ) ) ;
69
+ setIsCustomDialogOpen ( false ) ;
70
+ setCustomUrl ( "" ) ;
71
+ setSelectedTemplate ( "" ) ;
74
72
} ;
75
73
76
74
const handleTemplateSelect = ( templateKey : string ) => {
@@ -166,7 +164,7 @@ const MapTileLayerProviderSelect = (props: Props) => {
166
164
< Label htmlFor = "custom-url" > { t ( "setting.preference-section.map-config.tile-server-url" ) } </ Label >
167
165
< Textarea
168
166
id = "custom-url"
169
- placeholder = "https://your-tileserver.com /{z}/{x}/{y}.png"
167
+ placeholder = "https://{s}.tile.openstreetmap.org /{z}/{x}/{y}.png"
170
168
value = { customUrl }
171
169
onChange = { handleUrlChange }
172
170
className = "mt-2 min-h-[40px] resize-none"
@@ -204,9 +202,7 @@ const MapTileLayerProviderSelect = (props: Props) => {
204
202
< Button variant = "outline" onClick = { ( ) => setIsCustomDialogOpen ( false ) } >
205
203
{ t ( "common.cancel" ) }
206
204
</ Button >
207
- < Button onClick = { handleCustomUrlSubmit } disabled = { ! customUrl . trim ( ) } >
208
- { t ( "setting.preference-section.map-config.apply" ) }
209
- </ Button >
205
+ < Button onClick = { handleCustomUrlSubmit } > { t ( "setting.preference-section.map-config.apply" ) } </ Button >
210
206
</ DialogFooter >
211
207
</ DialogContent >
212
208
</ Dialog >
0 commit comments