jpsim / jpsim/JPSThumbnailAnnotation

Adding annotation to an array

Open
#21 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
474
Forks
77
PR merge metrics
No merged PRs in 30d

Description

func annotations() -> [JPSThumbnailAnnotation] {
    var annotations: [JPSThumbnailAnnotation] = []
    let pointData = NSData(contentsOfFile: NSBundle.mainBundle().pathForResource("1000", ofType: "geojson")!)
    let points = NSJSONSerialization.JSONObjectWithData(pointData!,
        options: nil,
        error: nil) as! NSDictionary
    for point in points["glimps"] as! NSArray {
        let a = JPSThumbnail()
        a.image = UIImage(named: "empire.jpg")
        a.title = "Empire State Building"
        a.subtitle = "NYC Landmark"
        let lat = (point as! NSDictionary)["latitude"] as! CLLocationDegrees
        let lon = (point as! NSDictionary)["longitude"] as! CLLocationDegrees

        a.coordinate = CLLocationCoordinate2DMake(lat, lon)
        a.disclosureBlock = { println("selected Empire") }
        let a1: JPSThumbnailAnnotation = JPSThumbnailAnnotation()

        annotations.append(a1)
    }
    return annotations
}

This is my code the annotations are appearing on top of each other, with no thumbnail for some reason, how can I fix this in swift?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the annotations() entry point and the JPSThumbnail and JPSThumbnailAnnotation usage shown in the issue. Reproduce the Swift example and inspect how the annotation objects receive their coordinates and thumbnail data. Done means the annotations no longer overlap unexpectedly and display their thumbnails.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.