Comments (11)
Hello,
currently reading KML files is beyond my TODO but if you find a reader that provides you with coordinates you should easily add tracks and polygons (see Demo actions under btnAddRouteClick for tracks and mMapDrawLayer for polygon)
from delphi_osmmap.
I communicating with [Fr0sT-Brutal with my KML reader
and allowing him to add it to his source
I am using his source to change from Google to open street
this is the application I am changing
https://limelect.com/downloads/kml-reader/
I can send you a demo although [Fr0sT-Brutal has my source
from delphi_osmmap.
from delphi_osmmap.
@ClubACNews what exact error do you have?
I made a VERY quick, dirty and dumb KML loader and it works (loads from fixed-named 'route.kml' file near the EXE)
procedure TMainForm.Button1Click(Sender: TObject);
var
sl: TStringList;
i: Integer;
s: string;
fs: TFormatSettings;
Track: TTrack;
coords: TStringDynArray;
begin
sl := TStringList.Create;
sl.LoadFromFile('route.kml', TEncoding.UTF8);
// look for first '<coordinates>' line, then consider next line as space-separated series of geo points
for i := 0 to sl.Count - 1 do
if Trim(LowerCase(sl[i])) = '<coordinates>' then
begin
s := sl[i + 1];
Break;
end;
if s = '' then Exit;
sl.Delimiter := ' ';
sl.DelimitedText := s;
fs := TFormatSettings.Create(LOCALE_NEUTRAL);
fs.DecimalSeparator := '.';
Track := TTrack.Create;
SetLength(Track.Points, sl.Count);
for i := 0 to sl.Count - 1 do
begin
coords := SplitString(sl[i], ',');
Track.Points[i] := TGeoPoint.Create(StrToFloat(coords[0], fs), StrToFloat(coords[1], fs));
end;
Track.LineDrawProps := DefLineDrawProps;
Track.LineDrawProps.Color := RandomColor;
mMap.Tracks.Add(Track);
FreeAndNil(sl);
end;
from delphi_osmmap.
Hi,
I give you a kml file and it's representation on a map.
Now, i use an release 2.26 of Lazarus and I don't know how to use this component if I need the latest version in development. I don't want to break what it works
Croquis E1-E5.zip
from delphi_osmmap.
Built with trunk FPC/Laz, 1st region is OK (but had to modify the KML as the loading code is DUMB and expects coords on a separate line. Also FPC has no TFormatSettings.Create so modification is needed:
{$IFDEF DCC}
fs := TFormatSettings.Create(LOCALE_NEUTRAL);
{$ELSE}
fs := DefaultFormatSettings;
{$ENDIF}
from delphi_osmmap.
excellent !
In the example, there are 5 zones denoted E1 to E5. Is it possible to load them all at once?
I'm going to create a virtual machine and install a Lazarus trunk in it.
I have an example source for creating filled polygons. How can I give them to you without going through an attachment from this github? This is a licensed component.
I create my kml from a French government site "geoportal" allowing you to select different base maps to easily locate and delimit the area that the archaeologists are going to excavate. The KML format is imposed during registration by the site.
from delphi_osmmap.
It is possible of course - just use proper XML reader to find all the coord nodes. Lazarus has it built-in.
If you need filled regions, tracks likely won't fit - you'll have to draw the regions by yourself. See the mMapDrawLayer method in Demo for example and read TCanvas' reference (namely Polygon). ATM I have no plans of adding regions but who knows... maybe if you succeed in this, you'll contribute the code for others ;)
from delphi_osmmap.
Hello everyone
I rarely enter GitHub, but looking for an application to monitor maps, I found this one that seemed like a fantastic job, so I decided to collaborate
I am Spanish and I am translating into English with Google, so forgive my English
I see that among the pending tasks is being able to view Track and Waypoint in different formats, although this thread talks about KML
I have prepared a Unit to load Track and Waypoint files in Kml, Gpx, Csv, Txt formats called OSM.TracksAndMarks
For Waypoints or Marks, I have added two new icon formats, gshRectangle and gshEllipse, so I have modified the OSM.MapControl unit to add them. In the header of the unit is the description of the changes, which were made on the latest version v.0.11.4
To load the Track and Waipoint, just add two buttons to the MainForm, one for the Marks and one for the Tracks, along with a TComboBox to define the color of the Track. The necessary code is put in the header of OSM.TracksAndMarks
As this is the first time I collaborate on Github and contribute code, I don't really know how to proceed, so you can download the two units OSM.TracksAndMarks and OSM.MapControl from my DropBox in this link
https://www.dropbox.com/scl/fo/1plv13h8alqkl0nfrzye1/h?rlkey=6uml3vf7hw4o9kpxbpu6xqaaq&dl=0
The code explains the necessary format for .Csv and .Txt files
To load the marks, I have added some standard configuration procedures for each drawing form, which must be executed before loading the files
The only problem I have encountered is that the Track lines always overlap the Waypoint / Marks, and I can't find anywhere to do a BringToFront to be able to leave the Tracks below
Also missing is the ability to load Google orthophotos, although I see that you are working on it
Regards
from delphi_osmmap.
I already used this component
https://limelect.com/downloads/kml-reader/https://limelect.com/downloads/kml-reader/
Check kml files as there are strange one
put a test program here as I have many odd kml or gpx
my program read them all
or send it to me to check
from delphi_osmmap.
Hello everyone
Hello, thanks for contribution! I'll try to examine it in near time
from delphi_osmmap.
Related Issues (20)
- Zoom by mouse wheel and hide scrollbars HOT 4
- Proposal for project modification HOT 11
- TO-DO List
- firemonkey support HOT 1
- Error HOT 2
- TileProvider small modifications HOT 4
- Popup menu HOT 2
- Opacity HOT 2
- Draw polygon HOT 2
- How to repaint the OSM.MapControl and how to find canvas coordinate in OnDrawTile HOT 2
- Polygone area HOT 4
- show a spécific region of a map HOT 1
- Trunk to Stable ? HOT 2
- zoom Error HOT 1
- TileURL
- OSMMap and Lazarus 3.00 HOT 3
- Zoom position HOT 1
- License HOT 4
- Optimize the download of the tiles HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delphi_osmmap.