Efficient custom tile cards with customizable zoom levels and scaling factors

I need to implement a very customizable layer / map view on iOS5 / 6 (iPhone), which downloads tiles as images and / or data (JSON) from the server. This is similar to Google maps, but at specific points it is very specific, so I cannot easily use the solution, for example:

  • google maps or
  • route-me (used by MapBox)
  • CATiledLayer in combination with UIScrollView

The fact is that: None of the solutions really help me, due to my specific specifications. If you think there is a suitable solution , please tell me.

If not:
Help me find the best solution for my business !!!

"But why can't I use these beautiful solutions?"
There are several limitations that should be known:

  • We use only 3 zoom levels (0.1 and 2)

  • Each tile has nine subtiles in the next scalable level (= scaling factor 3) (not like most other sets do with 4 subtiles = zoomfactor 2)

  • The first layer has an initial size (speaking in pixels / dots - half) 768 * 1024. The
    second layer is three times wider and higher (zoomfactor 3 !!!) → 2304 * 3072
    The third layer is equally wider and higher than the second → 6912 * 9216

  • Each fragment that comes from the server has a size of 256x256 pixels

  • , 9 (12 1- , 108 2-, 972 )

  • ( 6 ) ( ) ( JSON 10-15 )
    - > JSON (, google), , (, , )

  • ,

  • -/- , .

:

  • . CoreData

  • UIScrollView,

  • , , , .

  • ( iPhone 5 320x500)

  • , . , / . "-", , . ?

  • , , . -JSON. JSON- ( " , , " ), ( DB/Disc Server)

  • UIScrollView ,

  • CALayer ? ""?

!!!

+5
3

( TiledLayer):

CATiledLayer View scrollView. CALayer . . scrollview . Thats perfect!!!

- → , , .


:

:

  • UIScrollView View/Controller
  • UIView ( tileView) contentView ScrollView - , ScrollView ( - 1)
  • ( 1 9)
  • tileView, 9 - , ( , )
  • , CALayer (tiles) addSublayer: tileView
  • , zoomFactor 3 ( - 1 Tile in layer 0 - zoomFactor 1 3x3 = 9 1 - zoomFactor 3)
    • 0 , 3x4 243x243 (3 3) ( tileView). , CALayer contents. zoomFactor 3 (, Google).
    • zoomFactor 3, 12 3 (81x81 ). 9 .
    • , 3 , - .contents CALayer. 81x81, ( ) , , 243x243 8181 CALayer, zoomFactor 3 243x243 .

zoomFactor (3,9,12) . , , ​​ zoomFactor, .

, zoomFactors, 3 .contents. , ZoomLevel.

, , - . .

, , - , , .

+2

TiledLayer , CATiledLayer ( , CATiledLayer ).

Github.

Fab1n: , .

+2

All Articles