Menu

Using MapView - how to center the map on a latitude and longitude in code?

Bryan
2014-01-11
2014-02-01
  • Bryan

    Bryan - 2014-01-11

    Hi all,
    I'm really excited about these components, but I can seem to figure out how to do a few things with the MapView/MapKit

    I would like to know how to:
    1. center the map at a Lat / Lon
    2. Add a circle to the map
    3. Add a label to the map
    4. Add a polygon to the map

    This should be fairly easy, but I'm new to these components and iOS programming.
    Any short examples would be greatly appreciated.
    Cheers,
    Bryan

     
  • Bryan

    Bryan - 2014-01-25

    Has anyone had success doing this? Any simple demos?

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-01-26

    Hi Bryan

    • Added TDPFMapView setCenter
    • Added TDPFMapView AddCircle
    • Added TDPFMapView AddPolyLine
    • Added TDPFMapView AddPolygon
    • Added TDPFMapView Custom AddAnnotation

    Download last source [code] and see "MapView User Location" demo.Please let me know about it.

    Regards

     

    Related

    Code: code

  • Bryan

    Bryan - 2014-02-01

    Thanks Babak,
    I tried the demo app and it crashed with an access violation, then I ran it again from the iPad (not simulator) and it work, but the zoom in and zoom out did not work, but the add circle, polyline and polygon did work.

    Looking at the MKMapView unit, I noticed the TOverlayInfo has a FillColor, StrokeColor, LineWidth and Alpha. It seems the Alpha is set for the fill and the line itself. Is there any way to have two separate Alpha ... one for the line and one for the fill. For example, I want the line to have an alpha of 1 (not transparent), and the fill to be set to what I want. Currently the alpha controls both line and fill together.

    Many thanks for the demo and the update.
    Regards,
    Bryan

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.