/home/v1/Lazarus_Qt/lazarus/packager/kcMapViewer.pas(1,1) Fatal: Can't find unit httpsend used by kcMapViewer
What else do I should install ?{$mode objfpc}{$H+}
to kcMapViewer.pas otherwise it told me:{$IFDEF USE_SYNAPSE}
procedure DownloadFile(const Url: string; str: TStream);
var
HTTP: THTTPSend;
begin
HTTP := THTTPSend.Create;
try
HTTP.ProxyHost:='127.0.0.1';
HTTP.ProxyPort:='8080';
HTTP.ProxyUser:='user';
HTTP.ProxyPass:='password';
if HTTP.HTTPMethod('GET', URL) then
begin
str.Seek(0, soFromBeginning);
str.CopyFrom(HTTP.Document, 0);
end;
finally
HTTP.Free;
end;
end;
{$ELSE}
It may be nice to add properties to the component to set the proxy.I found solution for this. Please wait for next version.
Would you be willing to add this to Lazarus-CCR or a more formal repository ?I have no access and I don't know how.
QuoteIt may be nice to add properties to the component to set the proxy.I found solution for this. Please wait for next version.QuoteWould you be willing to add this to Lazarus-CCR or a more formal repository ?I have no access and I don't know how.
Do you know how to use revision control systems? If not, you can learn it quickly.I have only local bazaar vcs
Both projects use Synapse, and both plan on LGPL for the libraries, so I think we should combine efforts. kcMapviewer is more of a component, while Gemba is an application which requires a lot of libraries - but there is still a reasonable amount of overlap.
Testing kcMapViewer on Mac OS I found the following trivial issues:
1. Windows unit should be commented out.
2. cthreads needs to be added a lot of places to prevent runtime error 211.
if you need a webpage/bugtracker page/svn i can offer my server. Even i think it is better you put it in sourcefoge or google.
Is there a mobile strategy or angle here at all?Basically I would like to create on every target where LCL works (TCustomControl control), actually I have some problems with thread pool and slow canvas.
How can i work with you guys to extend it ( Overlays, Markers, Lnet as DownloadEngine for use in WinCE etc ) ?Whe can work on distributed vcs (hg) using code.google or svn and merge everything using patches. Currently its not a big projects so we can operate flexible (sorry for english google translate help me ;) )
QuoteIs there a mobile strategy or angle here at all?Basically I would like to create on every target where LCL works (TCustomControl control), actually I have some problems with thread pool and slow canvas.
Next step is add paths, POI. I need this component:
* for gps logger (photo tagging / track viewer) based on HOLUX M-260 or similar devices,
* to manage distributed network devices - probably visual drawing system (visio style would be great but canvas is slow and I would like not to change it)
QuoteHow can i work with you guys to extend it ( Overlays, Markers, Lnet as DownloadEngine for use in WinCE etc ) ?Whe can work on distributed vcs (hg) using code.google or svn and merge everything using patches.
Currently its not a big projects so we can operate flexible (sorry for english google translate help me ;) )
<snip>
Well, if you are interested (now or in future) in mobile mapping and/or mobile GIS, there's a surprising number of options available for developers to pick from.
<snip>
Phil you're right and wrong.
Basically two things come to my mind :
1) There is no component ( that i know ) for Lazarus / Free Pascal and switching my favorite and most productive programming language is not my first option.
2) Google or Microsoft API license. It's not open / free and most of the frameworks / components use the API extensively. I don't want to use the API ( the cost of a license is very high for me ).
Can't open include file "sswin32.inc"
Has anybody made progress with offline maps from openstreetmap instead of the webservice? Is there an installable renderer?
that is to run a local OSM instance.You mean PostGIS etc? Could be done I suppose, but IIRC it's a lot of work to set up...
that is to run a local OSM instance.You mean PostGIS etc? Could be done I suppose, but IIRC it's a lot of work to set up...
Has anybody made progress with offline maps from openstreetmap instead of the webservice? Is there an installable renderer?http://forum.lazarus.freepascal.org/index.php/topic,22103.msg133455.html#msg133455
At the present moment there is no packageShould be easy to packagify, if the difference with original package is only at the rendering part. I'll take a look later since I don't have any needs for map ATM.
No i rewrited some part from 0 because i'm new in lazarus(i'm more skilled with delphi), and i think it's a good manner to learn.
actually need the patch for issue 27144 (http://mantis.freepascal.org/view.php?id=27144) for correctly drawing
I did. But what I want is to convert long/lat (extended) to x/y (integer) depending on zoom level.
SetCenterLongLat is close to what you want.Thanks for the tip. Here is my solution:
function TMapViewer.GetLongLatMap(AValue: TRealPoint): TIntPoint;
var
shift: Extended;
mx, my: Extended;
res: Extended;
begin
shift := 2 * pi * EARTH_RADIUS / 2.0;
mx := AValue.X * shift / 180.0;
my := ln( tan((90 - AValue.Y) * pi / 360.0 )) / (pi / 180.0);
my := my * shift / 180.0;
res := (2 * pi * EARTH_RADIUS) / (TILE_SIZE * IntPower(FZoom));
Result.X := abs(Round((mx + shift) / res + FX)) + dx;
Result.Y := abs(Round((my + shift) / res + FY)) + dy;
end;
dx, dy are the former local values ax, ay assigned in RepaintMap().Hi to all.
I want to use a TMapviewer comptonent but i am confused.
Can anybody send a url to dowloand ?
Thanks a lot
Can't install the component. LAZGRBraphic.lpk is missing ...
Useless, that's all I can say for the moment.
Can't install the component. LAZGRBraphic.lpk is missing ...
Useless, that's all I can say for the moment.
Try the adaption that I put on CCR: https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/lazmapviewer/. I removed the dependence on rgbagraphics, but is has a memory leak. I cannot focus on this component at the moment, and would appreciate any contributions finding this leak in these ugly threads.
One more question. I changed the cross into an ellipse. It would be interesting to click on an ellipse (a GPS point) to display eg information in a dialog with properties (some text).The idea is to create an elliptic region with the bounding rectangle's coordinates, something like this:
I am writing a small program to visualize the detection of cosmic rays on a map. Detections are made by smartphones of people participating in the CREDO project of the Institute of Nuclear Physics in Krakow.Cool.
Now I added also an event OnDrawGpsPoint to the MapViewer.This will be very useful. Thanks!
Isn't the sample demo which comes with lazmapviewer sufficiently fast?Here is example of moving lazmapviewer example on full screen (2560x1440) from left to right (so all tiles are cached): laz.jpg and frame rate is about 1-2 FPS. With TImage example is 60FPS with little or no cpu usage: timage.jpg
am I using an old library file or something?How should I know?
SetCenterLongLat is close to what you want.Thanks for the tip. Here is my solution:Code: [Select]function TMapViewer.GetLongLatMap(AValue: TRealPoint): TIntPoint;
dx, dy are the former local values ax, ay assigned in RepaintMap().
var
shift: Extended;
mx, my: Extended;
res: Extended;
begin
shift := 2 * pi * EARTH_RADIUS / 2.0;
mx := AValue.X * shift / 180.0;
my := ln( tan((90 - AValue.Y) * pi / 360.0 )) / (pi / 180.0);
my := my * shift / 180.0;
res := (2 * pi * EARTH_RADIUS) / (TILE_SIZE * IntPower(FZoom));
Result.X := abs(Round((mx + shift) / res + FX)) + dx;
Result.Y := abs(Round((my + shift) / res + FY)) + dy;
end;
Would be nice to have intermediate steps of zoom by stretch drawing tiles. It's a pity that Maciej doesn't continue the project.
This would be great, because opentopomap gives you very beautiful maps, suitable for hiking.OpenTopMap has been added as map provider to LazMapViewer in the recent commit.
i get an SIGFPE Error run in IDE or "Invalid floating point operation." when start exe.Improved the numerics in the new revision. Should be fixed.
i cant understand this?No problem here when I follow your steps. Maybe a consquence of the SIGFPE you reported. Please update and check again.
Try the adaption that I put on CCR: https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/lazmapviewer/.
And i have found an bug in my TGPSListViewer.BtnCalcDistanceClick procedure.Fixed.
If delete an entry in list the calculation is wrong because the list entries does not match
the actual list.
In mvmapviewer.pas, line 165 to 217, is CopyPixels really needed as you have fixed this?The comment and bugtracker say that it is a workaround for a bug fixed after 1.8.4, i.e. the first release version having the fix must be Laz 2.0.0. This is too near for removal - otherwise all users having older versions are excluded from LazMapViewer. Look here in the forum at all the Linux users forced by their distro to ancient versions, and when a fix is already in the source there is really no reason to force them to an upgrade.
could this help to fix MacOS?I don't have access to a Mac, so I cannot check. Again: Any help is welcome, I cannot focus too much on this component. And there's still the issue with the memory leak once the viewport is dragged or the zoom has been changed (https://forum.lazarus.freepascal.org/index.php/topic,12674.msg307870.html).
mvMapViewer.pas from line 794:
{$IFDEF WINDOWS} //rawImg.Description.Init_BPP24_B8G8R8_BIO_TTB(AWidth, AHeight); rawImg.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth, AHeight); {$ELSE} rawImg.Description.Init_BPP32_A8R8G8B8_BIO_TTB(AWidth, AHeight); {$ENDIF}
2.
could this help to fix MacOS?
mvMapViewer.pas from line 794:
{$IFDEF WINDOWS} //rawImg.Description.Init_BPP24_B8G8R8_BIO_TTB(AWidth, AHeight); rawImg.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth, AHeight); {$ELSE} rawImg.Description.Init_BPP32_A8R8G8B8_BIO_TTB(AWidth, AHeight); {$ENDIF}
Good.
I discovered the Google maps recently, the black maps seem to be overlays of the base maps. Could not yet figure out how to accomplish this.
The OviMaps links are outdated. They refer to Nokia maps which no longer exist. I should remove them from the code.
I think Nokia is now Here (https://wego.here.com/).Fine. But the problem is that we need to find out the exact url to these maps including the conventions how to provide longitude, latitude and zoom level. See TMapViewerEngine.RegisterProviders:
could this help to fix MacOS?Yes, that did the trick.
mvMapViewer.pas from line 794:
{$IFDEF WINDOWS} //rawImg.Description.Init_BPP24_B8G8R8_BIO_TTB(AWidth, AHeight); rawImg.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth, AHeight); {$ELSE} rawImg.Description.Init_BPP32_A8R8G8B8_BIO_TTB(AWidth, AHeight); {$ENDIF}
I think Nokia is now Here (https://wego.here.com/).Fine. But the problem is that we need to find out the exact url to these maps including the conventions how to provide longitude, latitude and zoom level. See TMapViewerEngine.RegisterProviders:where %serv%, %x%, %y%, %z% are replaced by service-specific parameters for server, x (longitude), y (latitude) and zoom label
AddMapProvider('Ovi Normal', 'http://%serv%.maptile.maps.svc.ovi.com/maptiler/v2/maptile/newest/normal.day/%z%/%x%/%y%/256/png8', 0, 20, 5, @GetLetterSvr);
Google maps, for example, are downloaded by this URL: 'http://mt0.google.com/vt/lyrs=m@145&v=w2.104&x=1203&y=1538&z=12'
A very simple question to you: What is the define to identify Mac? The code above crashes Linux which does not like the Alpha channel byte.
OpenStreetMap is friendly, but still has restrictions on use of their serversYou can download OSM maps and render them locally. You can not do that with Google Maps.
OpenStreetMap is friendly, but still has restrictions on use of their serversYou can download OSM maps and render them locally. You can not do that with Google Maps.
Yes. You can find them as png in the cache folder of the demo application.
[HERE]
APP_ID=ABC
APP_CODE=xyz
Another issue is that I do not get the fphttpclient to accept the https url. Therefore, I used the synapse downloader in the demo for the moment.
I get the idea that maybe the "0" in "0.base.maps..." is not valid;
For symmetry:
procedure DistanceToLatLong(const lat0, long0, dist, bearing: double; var lat1, long1: double); var R: double = 6371000.0; // earth radius in meters d, x, y: double; begin d := dist/R; // angular distance lat1 := ArcSin(Sin(lat0) * Cos(d) + Cos(lat0) * Sin(d) * Cos(bearing)); x := Cos(d) - Sin(lat0) * Sin(lat1); y := Sin(bearing) * Sin(d) * Cos(lat0); long1 := long0 + ArcTan2(y, x); end;
The earth is an ellipsoid - at the poles the radius is about 21 km less than at the equator.So then, why do you care about the difference between 6371000 and 6378137 when you do not use the exact formula for an ellipsoid? And even worse, as wikipedia shows (https://en.wikipedia.org/wiki/Earth_radius#Published_values), the former value is almost exactly the radius of the "average" sphere (having the same volume as the ellipsoid) while your value is the radius at the equator (major axis). Using this will overestimate all distances (except for those near the equator) while the former one leads to a more evenly distributed error.
... This can lead to 0.5% deviation.
This is a very useful component and I could only try it out now. :( I even got it right to display points in different colours depending on the ELE value. But what I could not get right is to display the NAME as a label. I saw in the examples that there were some attempts with the ADrawer TextOut and TextExtent functions/procedures but they are not working and I guess therefore commented out. Trying to use them crash the application with lots of Access Violations. Anyone any other ideas on how one could display the labels?It's been some time since I was in the depths of this component... Normally it is enough to "add" a TGpsPoint to the GpsItems of the MapView, and the drawing engine will take care of the drawing. This is the code from the demo program where a point can be marked by a right click:
@mpknap
you hace some examples in the same directory of Tmapviwer files
You are right, the sample application does work with a database. But it shows how you can draw a marker at given coorindates in the map. So, you only must extract your coordinates from the database and follow the sample code.
I don't know what they do in the movies when the hero asks the assistant to zoom in further so that the tiny license plate becomes readable...There was a program that converted image to fractals (ca. 1996-1997, I got it from some BBS). It replaced the tiles of BMP with appropriate fractals. The generated fractalized pictures were at least 10x more "zoomable" than a BMP.