Fr0sT-Brutal / Delphi_OSMMap

Visual control for Delphi and Lazarus to display OSM map
Mozilla Public License 2.0
66 stars 23 forks source link

Proposal for project modification #11

Closed array81 closed 2 years ago

array81 commented 3 years ago

This weekend I worked on making some major changes to the library. My idea is to create a "universal" component for map tiles. I have modified the code so that it is possible to create "tiles providers". So I created a provider for OSM (this works like in your library) and now I'm working on some providers for Google and Here they still don't work since I have to implement the APIKEY. The code is not perfect, there are bugs and things to fix and optimize but it works. I have tried to keep the original code as possible. Could it interest you? Or do you prefer me to create a folk?

Fr0sT-Brutal commented 3 years ago

Impressive! Seems we'll have to rename the component then :) Please publish your code somewhere, I'll look at it.

array81 commented 3 years ago

This is the code: https://www.dropbox.com/s/64jzk3lcnfm0y6b/Delphi_OSMMap_mod_array81.zip?dl=0 It is an alpha code. The OSM provider works, Google and Here need APIKEY implementation. I renamed all the units. Let me know what your intentions are. If you don't want to change your project I can always make a folk.

Fr0sT-Brutal commented 3 years ago

Well... this is pretty big modification. I think I'll merge changes slowly one by one. As I see all providers seem using the same 256*256 tile sizes (checked maps.yandex.ru as well)? With this assumption we can simplify things.

array81 commented 3 years ago

I think BING allow use both 256px and 512px. In general 256px is more common but I would not eliminate the possibility of varying the size.

Fr0sT-Brutal commented 3 years ago

Thanks for your efforts! I started temporary branch https://github.com/Fr0sT-Brutal/Delphi_OSMMap/tree/feat_multi-provider to implement the feature. Demo is working (OSM only).

I still not renaming the project and units have their old names except for network requests that use standard naming <project>.<baseclass>[.<implementation>].pas with base declared in <project>.<baseclass>.pas just like in FMX, FireDAC and other. TilesProvider units are named in the same manner.

I still have some changes in OSM.MapControl and OSM.SlippyMapUtils to add but Demo works now.

I added you as co-author to TilesProvider units, let me know if this link to GH is OK

array81 commented 3 years ago

The HERE provider works. I tested it, just add your APIKEY and it works. I think should add "language" and "layer" to TTilesProvider to customize the tiles language and tiles "type" (street, satellite, ...)

Fr0sT-Brutal commented 3 years ago

Nice to know! I'll add the unit then.

I think should add "language" and "layer" to TTilesProvider

Hmm, there could be lots of such props specific to just a single provider. I'd rather add stringlist for such stuff.

Fr0sT-Brutal commented 3 years ago

Added HERE: ddf1dd51f43eeaefa47bd281a2459ef5a5a506d6 Added abstract string Properties: f6060088055c52fca16616f3ecd72d85d87265f0

fabianopaolini commented 2 years ago

Hi, I'm interested to have different providers... I'm trying to use "OpenTopomap" provider and now I must change the OSM.SlippyMapUtils code... How is this fork? Can I help you to go on?

Fr0sT-Brutal commented 2 years ago

Thanks for reminding me about this project, I totally forgot to merge the branch. Now it's in master 0.9.0. So just check how OSM/HERE provider implemented, create a unit in the same manner and post PR.

Fr0sT-Brutal commented 2 years ago

@array81 Added Google to master branch, now your changes seem to be fully integrated (except for tile format and size - not needed currently). Let me know if you need something else ;)