-
Notifications
You must be signed in to change notification settings - Fork 396
Conversation
Adds the Identify KML Features sample.
@qsmmorgan Unfortunately the font size is embedded in the html: <font size="+1"><b>Flash Flooding is possible</b> in the enclosed area during Wed, Sep 19, 2018.</font> I don't know if there's a way to modify that. |
@philium One option to consider is converting the HTML to func showCallout(for placemark: AGSKMLPlacemark, at point: AGSPoint) {
let contentData = placemark.balloonContent.data(using: .utf8)!
let attributedText = try? NSMutableAttributedString(data: contentData, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil)
let textView = UITextView(frame: CGRect(origin: .zero, size: CGSize(width: 320, height: 100)))
textView.attributedText = attributedText
textView.backgroundColor = placemark.balloonBackgroundColor
mapView.callout.customView = textView
mapView.callout.show(at: point, screenOffset: .zero, rotateOffsetWithMap: false, animated: true)
} This makes the font size slightly larger by default and lets the developer customize the text any way they like. It also makes the callouts native without the web view overhead. |
Stack Trace
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note on the image: it would be nice to show the map with actual data and a callout, but not many people see the image anyway.
Looks good overall! I added some minor feedback. The only thing I really think needs to be addressed somehow is the callout text size I mentioned earlier.
arcgis-ios-sdk-samplesTests/Sample Tests/IdentifyKMLFeaturesViewControllerTests.swift
Show resolved
Hide resolved
arcgis-ios-sdk-samples/Layers/Identify KML features/IdentifyKMLFeaturesViewController.swift
Show resolved
Hide resolved
arcgis-ios-sdk-samples/Layers/Identify KML features/IdentifyKMLFeaturesViewController.swift
Show resolved
Hide resolved
arcgis-ios-sdk-samples/Layers/Identify KML features/IdentifyKMLFeaturesViewController.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the comments made by @qsmmorgan regarding the image and the text size in the callout, sample is looking good and working as expected
@qsmmorgan I agree that it would be nice to show the callout. Unfortunately there were no weather events when I took the screenshot. I'll try again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Adds the Identify KML Features sample. Corresponding iOS PR: Esri/arcgis-runtime-samples-ios#498
Adds the Identify KML Features sample.