You've already forked lazarus-ccr
lazmapviewer: Fix usage of UTF-8 in search function. SourceForge issue #52, patch by Manhisz Vanna
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8200 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -77,6 +77,9 @@
|
|||||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
</SearchPaths>
|
</SearchPaths>
|
||||||
<Linking>
|
<Linking>
|
||||||
|
<Debugging>
|
||||||
|
<DebugInfoType Value="dsDwarf2Set"/>
|
||||||
|
</Debugging>
|
||||||
<Options>
|
<Options>
|
||||||
<Win32>
|
<Win32>
|
||||||
<GraphicApplication Value="True"/>
|
<GraphicApplication Value="True"/>
|
||||||
|
@ -26,7 +26,6 @@ object MainForm: TMainForm
|
|||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
MapProvider = 'OpenStreetMap Mapnik'
|
MapProvider = 'OpenStreetMap Mapnik'
|
||||||
POIImages = POIImages
|
POIImages = POIImages
|
||||||
POIImagesWidth = 0
|
|
||||||
UseThreads = True
|
UseThreads = True
|
||||||
ZoomToCursor = False
|
ZoomToCursor = False
|
||||||
OnZoomChange = MapViewZoomChange
|
OnZoomChange = MapViewZoomChange
|
||||||
@ -40,9 +39,9 @@ object MainForm: TMainForm
|
|||||||
Height = 640
|
Height = 640
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 275
|
Width = 275
|
||||||
ActivePage = PgConfig
|
ActivePage = PgData
|
||||||
Align = alRight
|
Align = alRight
|
||||||
TabIndex = 1
|
TabIndex = 0
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object PgData: TTabSheet
|
object PgData: TTabSheet
|
||||||
Caption = 'Data'
|
Caption = 'Data'
|
||||||
|
@ -68,21 +68,6 @@ const
|
|||||||
SEARCH_URL = 'http://geonames.org/search.html?q=%s'; //&country=%s';
|
SEARCH_URL = 'http://geonames.org/search.html?q=%s'; //&country=%s';
|
||||||
|
|
||||||
|
|
||||||
function CleanLocationName(x: string): string;
|
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
begin
|
|
||||||
Result := '';
|
|
||||||
for i := 1 to Length(x) do
|
|
||||||
begin
|
|
||||||
if x[i] in ['A'..'Z', 'a'..'z', '0'..'9'] then
|
|
||||||
Result := Result + x[i]
|
|
||||||
else
|
|
||||||
Result := Result + '+'
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{ TMVGeoNames }
|
{ TMVGeoNames }
|
||||||
|
|
||||||
procedure TMvGeoNames.FoundTagHandler(NoCaseTag, ActualTag: String);
|
procedure TMvGeoNames.FoundTagHandler(NoCaseTag, ActualTag: String);
|
||||||
@ -219,7 +204,7 @@ begin
|
|||||||
FLocationName := ALocationName;
|
FLocationName := ALocationName;
|
||||||
ms := TMemoryStream.Create;
|
ms := TMemoryStream.Create;
|
||||||
try
|
try
|
||||||
url := Format(SEARCH_URL, [CleanLocationName(FLocationName)]);
|
url := Format(SEARCH_URL, [FLocationName]);
|
||||||
ADownloadEngine.DownloadFile(url, ms);
|
ADownloadEngine.DownloadFile(url, ms);
|
||||||
ms.Position := 0;
|
ms.Position := 0;
|
||||||
SetLength(s, ms.Size);
|
SetLength(s, ms.Size);
|
||||||
|
Reference in New Issue
Block a user