3

I want to create original map as CATiledLayer. Layer hierarchy is like this above.

Map View (CATiledLayer)
----------------------
|  Pin (CALayer)     |
|  +-------+         |
|  | image |         |
|  +-------+         |
|                    |
|     Pin (CALayer)  |
|     +-------+      |
|     | image |      |
|     +-------+      |
|                    |
----------------------

Some 'Pin layer' are put on map view.

When zoom map, pin will zoom with map view. But I want to keep zooming pin layer, like original Map app in iOS.

Anybody knows good answer?

you_got
  • 31
  • 1

1 Answers1

-1

Have you set autoresizesubviews for the CATiledLayer?

[MapView setAutoresizesSubviews:YES];

Then make sure the Pins have been set with setAutoresizingMask

[PinView setAutoresizingMask:UIViewAutoresizingFlexibleHeight |UIViewAutoresizingFlexibleWidth];

You may need to set the margins too for the PinView to keep it in the right place.

Hope this helps.

mashdup
  • 875
  • 7
  • 18