We have a room plan and marker which must be placed on it by coordinates.
Swift 4.2.
Task:
build a simple view controller
add with autolayout a UIImageView (called map) embedded in an UIScrollView to support zoom and scroll
Load image from assets and assign to UIImageView in code
Let the image be zoomable with pinch-to-zoom and scrollable in zoom mode
On first showing the image zoom the image "out" so that it will be shown fitting on screen (set zoom scale)
Till here it simple now the more complex stuff:
add another UIImageView containing the marker pin
position the marker pin according to given PIXEL coordinates on the map
on zooming / pinching / scrolling the marker should NOT scale and should always stay on the given coordinated on map image
add a method to call the view with starting the view showing map with centered marker pin and zoomed in
on zooming, the marker should NOT scale. it should always stay in original size
So this is a little complicated described. here the user story:
The view should act in behavior like the map control: We have an map image and a marker pin. the user should be able to scroll around and zoom in/out while the marker always shows the desired coordinates. the view should be openable by two methods: a) show whole map image (zoomed out to fit) with the marker and b) show the detailed map image with centered marker pin zoomed into details level.
take care of:
the map image can be in every dimensions: eg 4000x800 pixels or 500x3500 pixels
the marker image can be positioned on every possible coordinate on map (always given in pixels!) - so position them properly!
the solution must work on each phone screen size (iPX, iP8, iP8+ etc)
About the recuiterMember since Mar 14, 2020 Adi Bangun Hard
from South Moravian, Czech Republic