Mapbox Crashing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • demando
    Senior Member


    • Aug 2008
    • 387
    • Woodland, California

    #1

    Mapbox Crashing

    Ok, now that I've got the heightmap situation fixed, now I get an unusual issue where when I click on the button to load the map, and click on the Z17 image, the program gets to its customary 42 bits, then crashes. I'm attaching my settings if anyone wants to take a gander. Apparently I'm really rusty at this.
    "Dream as if you'll live forever. Live as if you'll die today." - James Dean
    calrouteprojectmstsorts.weebly.com/
    https://cprrorts.weebly.com/
    Cheers, S. J. Hjellum
  • kapitaen
    Senior Member

    • May 2010
    • 331
    • Germany
    • German + a little bit English
    • MSOR

    #2
    This line ist wrong
    imageMapsUrl = https://api.mapbox.com/styles/v1/hje...=view&access_t oken=.....................&zo omwheel=true&fresh=true#2/38/-34
    Please replace with
    imageMapsUrl = https://api.mapbox.com/styles/v1/mapbox/satellite-v9/static/{lon},{lat},{zoom}/{res}x{res}?access_token=
    ​
    I would not publish my API key.

    Jan

    Comment

    • demando
      Senior Member


      • Aug 2008
      • 387
      • Woodland, California

      #3
      Originally posted by kapitaen
      This line ist wrong

      Please replace with

      Jan
      So I've done that several times now, and nothing works. Also, Eric, could you kindly delete the file in this thread? For some reason my browser will not allow me to edit my post.
      "Dream as if you'll live forever. Live as if you'll die today." - James Dean
      calrouteprojectmstsorts.weebly.com/
      https://cprrorts.weebly.com/
      Cheers, S. J. Hjellum

      Comment

      • kapitaen
        Senior Member

        • May 2010
        • 331
        • Germany
        • German + a little bit English
        • MSOR

        #4
        Try this settings.txt
        Jan

        settings.txt

        Comment

        • demando
          Senior Member


          • Aug 2008
          • 387
          • Woodland, California

          #5
          This was what happened after updating the settings, Jan. Any idea what's going on?
          You do not have permission to view this gallery.
          This gallery has 1 photos.
          "Dream as if you'll live forever. Live as if you'll die today." - James Dean
          calrouteprojectmstsorts.weebly.com/
          https://cprrorts.weebly.com/
          Cheers, S. J. Hjellum

          Comment

          • kapitaen
            Senior Member

            • May 2010
            • 331
            • Germany
            • German + a little bit English
            • MSOR

            #6
            Originally posted by demando
            Any idea what's going on?
            It says you should look in your LogTxt. This is located in the TSRE directory.
            Maybe the api key is not valid.
            Jan

            Comment

            • eric
              9500 Post Veteran and Administrator



              • Dec 2002
              • 9583
              • NS MP245.4 CNO&TP South District
              • English, SQL
              • General

              #7
              The structure of the map box URL is slightly different from a few years ago. I've also taken out the API key from the URL string and put it in its own field in the settings file.

              What you could try doing is renaming your settings file, start up tsre, and use the default settings file that gets created because yours is missing. Then just transfer over the API value into the related string and uncomment out all of the map box related fields including the zoom offset.
              If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

              Comment

              • demando
                Senior Member


                • Aug 2008
                • 387
                • Woodland, California

                #8
                Am I doing something wrong here? Because I'm doing what you're suggesting Eric, and it's just not loading? Does anybody have information on how to get the API key/access token to work? I'm really at a loss here.
                Attached Files
                "Dream as if you'll live forever. Live as if you'll die today." - James Dean
                calrouteprojectmstsorts.weebly.com/
                https://cprrorts.weebly.com/
                Cheers, S. J. Hjellum

                Comment

                • demando
                  Senior Member


                  • Aug 2008
                  • 387
                  • Woodland, California

                  #9
                  I finally got the access tokens right, but when I click on Z17, it loads to 41 and crashes the program. Is there something I need to fix on the Mapbox side? If so, what?
                  "Dream as if you'll live forever. Live as if you'll die today." - James Dean
                  calrouteprojectmstsorts.weebly.com/
                  https://cprrorts.weebly.com/
                  Cheers, S. J. Hjellum

                  Comment

                  • demando
                    Senior Member


                    • Aug 2008
                    • 387
                    • Woodland, California

                    #10
                    Just found the answer here "https://www.trainsim.com/forums/forum/open-rails/tsre-route-editor/155491-mapbox-api-key" and was able to successfully get the API to work. Only trouble is, it doesn't like Z17.
                    "Dream as if you'll live forever. Live as if you'll die today." - James Dean
                    calrouteprojectmstsorts.weebly.com/
                    https://cprrorts.weebly.com/
                    Cheers, S. J. Hjellum

                    Comment

                    • eric
                      9500 Post Veteran and Administrator



                      • Dec 2002
                      • 9583
                      • NS MP245.4 CNO&TP South District
                      • English, SQL
                      • General

                      #11
                      Is the zoom offset set to -1?


                      Sent from my SM-S911U using Tapatalk

                      If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

                      Comment

                      • demando
                        Senior Member


                        • Aug 2008
                        • 387
                        • Woodland, California

                        #12
                        I removed that line and the feature seems to work now.
                        "Dream as if you'll live forever. Live as if you'll die today." - James Dean
                        calrouteprojectmstsorts.weebly.com/
                        https://cprrorts.weebly.com/
                        Cheers, S. J. Hjellum

                        Comment

                        • eric
                          9500 Post Veteran and Administrator



                          • Dec 2002
                          • 9583
                          • NS MP245.4 CNO&TP South District
                          • English, SQL
                          • General

                          #13
                          You might have a false sense of security...

                          Code:
                           //// Route Editor MapBox Tokens  
                           // imageMapsUrl = https://api.mapbox.com/styles/v1/mapbox/satellite-v9/static/{lon},{lat},{zoom}/{res}x{res}?access_token=  
                           // imageMapsZoomOffset = -1         /// required for MapBox  
                           // MapAPIKey = {your API key}
                          MapBox made a bunch of changes after TSRE was finished, one of which was to change their definitions for zoom levels. the Z17 you might be used to with Google Maps is really Z16 in MapBox resolution. TSRE needs to change that Z17 you changed on the API call to Z16 to get the level of resolution you'd want.

                          I could have hard-coded the adjustment or changed the label dropdown dynamically based on what API credentials are provided, but I'd like to eventually set this up to allow both the Google and MapBox API to be accessible without resetting the Settings file and restarting the app.

                          Also, having changed the zoom definition once, there's nothing that says it can't change again the future or be adopted by Google Maps... If it changes and nobody's supporting TSRE, at least the adjustment can be made to retain the functionality.
                          If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

                          Comment

                          Working...