Giter VIP home page Giter VIP logo

Comments (8)

pauljohanneskraft avatar pauljohanneskraft commented on June 5, 2024

Hey - thank you very much for your kind words. No worries about asking questions.

I think the issue here is that you are either importing both MapKit and Map in the file this error occurs or neither. If you require both imports, you can use a Map. prefix to differentiate between the two different values from the two frameworks. In this case, it might make sense to change the line above to @State private var userTrackingMode = Map.MapUserTrackingMode.follow

from map.

rderimay avatar rderimay commented on June 5, 2024

Yeah. I tried this before contacting you, but I get another error:
image

Not sure what the problem is...

from map.

pauljohanneskraft avatar pauljohanneskraft commented on June 5, 2024

Okay, this is happening due to a name clash of the Map-struct inside the Map module and the Map module 😓

One workaround would be to use a custom name in your model for this one file - just for now - I will try to find a solution to this - probably by renaming MapUserTrackingMode to UserTrackingMode or getting rid of it altogether and using the MapKit one directly.

That additional file would only be the following:

import Map

typealias UserTrackingMode = MapUserTrackingMode

Then in your existing file, replace all usages of MapUserTrackingMode with UserTrackingMode

from map.

rderimay avatar rderimay commented on June 5, 2024

Yes this works, thanks!

from map.

rderimay avatar rderimay commented on June 5, 2024

Ah ah. No it does not.

I get this now:
Screen 2022-06-28 à 12 01 27

and this is directly connected to setting userTrackingMode: $userTrackingMode with @State private var userTrackingMode: UserTrackingMode = .follow

from map.

pauljohanneskraft avatar pauljohanneskraft commented on June 5, 2024

Yes, it is because it automatically sets showsUserLocation to true, which is then creating an annotation for that user location. Please simply update your package version and this assertion should be gone.

from map.

rderimay avatar rderimay commented on June 5, 2024

Switching to main instead of 0.1.0 does indeed solve the problem :-) Thanks!

from map.

pauljohanneskraft avatar pauljohanneskraft commented on June 5, 2024

Hey @rderimay ! I have just opened a new PR #16 which changes the type of the userTrackingMode to the previous MapKit MKUserTrackingMode value instead of creating a new custom type for this.

What do you think about this change?

from map.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.