0

I was going through the documentation of azure maps to integrate in iOS app, Requirement is simple or put a pin in azure and on click of pin should display some info.

Created the credential and could load the map using html. Post that I am trying to understand how exactly we can pin to the map, I see everywhere native SDK is about the expire and rather suggested to use WebSDK , But how do we just put a pin when in the map which is generated using html. HTML file is copied from text. Guide doesn't seem to address the exact issue

` webView = WKWebView(frame: view.bounds) webView.navigationDelegate = self

            view.addSubview(webView)

            // Load local HTML file
            loadLocalHTMLFile()
    
         
    // Do any additional setup after loading the view.
}
func loadLocalHTMLFile() {
       if let htmlPath = Bundle.main.path(forResource: "map", ofType: "html") {
           do {
               let htmlString = try String(contentsOfFile: htmlPath, encoding: .utf8)
               webView.loadHTMLString(htmlString, baseURL: Bundle.main.bundleURL)
           } catch {
               print("Error loading HTML file: \(error)")
           }
       } else {
           print("HTML file not found.")
       }
   }

I read the documentation and looked at the samples doesn't seem to address any issue putting the pin using swift

1 Answer 1

1

Adding a pin in Web SDK is nearly identical to the iOS native SDK. The main way is to create a data source for your data, then connect it to a rendering layer such as a Bubble or Symbol layer. This will use native WebGL rendering of the points allow you to render hundreds of thousands of points if needed.

If you only need to render a few points, the Web SDK also has an HTML Marker class that is more similar to how older web map platforms used to render points.

Here are a bunch of useful resources:

Sign up to request clarification or add additional context in comments.

2 Comments

More or less it worked , but now struggling pin the points (I have the points in swift native) and want to draw the HTMLMarker in the map, I could draw in html by writing everything in html , how to pass data to html/javascript function to draw maker
fixed it was expecting string instead long

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.