[BREAKING]
-
OSM.MapControl.pas: TMapMarkList.Find, ConsiderMapMarkSize argument replaced by TMapMarkFindOptions set and namely mfoConsiderGlyphSize value. However, it is not default anymore (and disallowed for searching by geo coords raising an exception because glyph size doesn't map reliably to geo coords). It didn't work before anyway.
End-user code required changes Modify all TMapMarkList.Find calls:
- Where you need to consider glyph size - use Find(TPoint, [mfoConsiderGlyphSize]) overload. Glyph size is only actual when dealing with pixels.
- In other places - use TMapMarkList.Find(GeoRect, [], idx) (will be forced by compiler)
- You may also want to include mfoOnlyVisible option
-
OSM.MapControl.pas: TMapMouseMode has changed its meaning. Now it reflects current map state of mouse events not the kind of reaction on mouse press-and-move. mmNone is default state, mmDrag/mmSelect renamed to mmDragging/mmSelecting.
End-user code required changes:
- Move mode setting from init section to MouseDown handlers. Or assign TMapControl.SelectionShiftState, DragShiftState instead
- Rename mmDrag/mmSelect to mmDragging/mmSelecting (will be forced by compiler)
Added
- OSM.MapControl.pas, TMapMarkCaptionStyle.Visible to control display of the caption
- OSM.MapControl.pas, TMapMarkList gets upgrades: enumerator to use in for-in loops, Find(Pointer) to search by .Data field, Delete(Integer) to remove item by index, default Items property to get rid of writing Get().
- OSM.MapControl.pas, TMapMarkList.Find(TPoint), overload that allows considering glyph size with mfoConsiderGlyphSize option set
- OSM.MapControl.pas, TMapMarkFindOptions, mfoOnlyVisible option to allow skipping invisible marks. Method calls TMapControl.MapMarkVisible to determine effective visibility considering not only Visible flag but also visibility of mapmark layer.
- OSM.MapControl.pas, TMapControl.MapMarkAtPos method to find topmost visible mapmark at given pixel coords.
- OSM.MapControl.pas: TMapControl.MapMarkVisible - Returns mapmark visibility based on mapmark's own property and also on currently selected visible layers of the map. TMapMarkList.Find methods all use this method.
- OSM.MapControl.pas, TOnSelectionBox now is called on every selection box change to reflect changes on-the-fly. Added parameter "Finished"
- OSM.MapControl.pas: TMapControl.OnMapMarkMouse(Down|Up) events
- OSM.MapControl.pas: TMapControl.SelectionShiftState, DragShiftState properties that set combination to enter selection/dragging state on mouse down. Assigning these properties removes necessity of handling MouseDown event just for changing map state
- OSM.MapControl.pas: ShiftStateIs function for correct comparison of shift states (to use in MouseUp|Move|Down event handlers)
Changed
- OSM.SlippyMapUtils.pas: EnsureInMap, ensures negative coords as well
- OSM.MapControl.pas: TMapControl.SetZoom, cancels selection/dragging
- OSM.NetworkRequest.pas, request props are cloned and assigned to every TNetworkRequestThread in its c-tor to avoid multithread access issues.
Fixed
- OSM.MapControl.pas: TMapMarkList.Find(TGeoPoint), fixed StartIndex not incremented
- OSM.MapControl.pas: fixed map dragging
[BREAKING]
-
Major redesign of NetworkRequest. Reuse connections to speedup downloads and reduce server load. Engine capabilities are checked against request details. API changes for implementations of NetworkRequest only, no changes visible to end-user.
-
OSM.NetworkRequest.pas, TBlockingNetworkRequestFunc => TBlockingNetworkRequestProc, must raise exception on error thus removing excess ErrMsg and result flag; add Client parameter. API changes for implementations of NetworkRequest only, no changes visible to end-user.
End-user code required changes: none except for custom implementations of NetworkRequest. For those:
- Function must be turned to procedure with other set of arguments (will be forced by compiler)
- Procedure should call engine capabilities check
- Procedure must raise exception on error
- Procedure should reuse existing Client object
Added
- OSM.NetworkRequest.Synapse.pas, to use SSL, define
SynapseSSL
in project options. - Updated Synapse to the last release version with original file structure. Added SSL libs from Synapse site (untested!)
- OSM.NetworkRequest.Synapse.pas, supports System proxy
- Tile URL is now defined with OpenLayers-compatible templates with extended features
Added
- OpenTopoMap tile provider
- OSM.TilesProvider.*.pas, use new template-base system for retrieval of tile URL
- Improvements for multi-provider apps
Added
TTilesProvider
, virtual constructor to allow creation via class types.TTilesProvider.Name
virtual method to return provider's label for display and other purposes.- Global list of tiles providers.
TTilesProviderClass
definition,TilesProviders
array,RegisterTilesProvider
function - Demo: support multiple providers
Fixed
- OSM.TileStorage.pas,
TTileStorage
, clear cache on file path change - OSM.MapControl.pas,
TMapControl
, fixes to change tiles provider properly
Added
- Google map tile provider
Added
- Ability to use map tile provider other than OSM. Added HERE provider. Added property
Properties
to access provider-specific properties.
[BREAKING]
- OSM.NetworkRequest.pas, uses
TileProvider
object.TNetworkRequestQueue.Create
, 3rd parameter isTTilesProvider
andGotTile
callback must be set viaOnGotTileBgThr
property - OSM.MapControl.pas, uses
TileProvider
object. NewTMapControl.TilesProvider
property
[BREAKING]
-
- Rename network request units according to generic rules:
OSM.NetworkRequest.%implementation%
- Rename network request units according to generic rules:
Added
TMapControl
, ability to tune cache image and label margin. AddTMapControl.LabelMargin
andTMapControl.SetCacheImageProperties
TMapControl.OnGetTile
callback that is somewhat simpler to use thanOnDrawTile
TMapControl
, export map view to image.TMapControl.SaveToBitmap
added
Fixed
TMapControl.SetZoom
now respectsMinZoom
valueTMapControl
, mapmarks won't be painted over labels
Added
- OSM.SlippyMapUtils.pas, add
ToTileHeightGreater
,ToTileHeightLesser
,ToTileWidthGreater
,ToTileWidthLesser
,ToTileBoundary
functions - Network requester allows to set current viewport of a map by
TNetworkRequestQueue.SetCurrentViewRect
method so that extraction of queued tiles first looks for those in this area. This removed time lag before current view area is fully downloaded and shown.TNetworkRequestQueue.DumbQueueOrder
property set toTrue
returns old behavior
Changed
- Network requester now by default cancels currently pending tiles when a tile with another zoom level is requested to make map viewable ASAP when a user zooms in/out quickly through multiple levels.
TNetworkRequestQueue.DumbQueueOrder
property set toTrue
returns old behavior
Added
- Introduced the concept of map layers. Mapmarks now are sorted by layer number so that the greater layer number, the later a mark is drawn. MapControl also has property VisibleLayers that allows control mapmarks visibility by layer
Changed
- TMapControl, doesn't call OnDrawMapMark if a mapmark is invisible or its layer is invisible
Added
- Greatly improved abilities of network engines. Added ability to specify proxy, request headers, login etc
- Proper handling of request errors
- Demo has proxy configuration