Google Maps API alternative

  1. ‹ Older
  2. 2 weeks ago

    Paul L

    Jan 9 Xojo Inc http://docs.xojo.com

    @MartinTrippensee Thanks Paul, didn't saw this. Looks like the MapPicture is in low resolution. Any chance to get it in high resolution e.g. for Retina Displays?

    I'm not sure. The code is just displaying the image it gets back from the API call.

  3. Bob K

    Jan 9 Pre-Release Testers, Xojo Pro Kansas City

    @MartinTrippensee Thanks Paul, didn't saw this. Looks like the MapPicture is in low resolution. Any chance to get it in high resolution e.g. for Retina Displays?

    On their homepage there are directions for getting high resolution images.

    Add @2x before the file extension on a URL to request an image at double scale

  4. Paul L

    Jan 9 Xojo Inc http://docs.xojo.com
    Edited 2 weeks ago

    @Bob K On their homepage there are directions for getting high resolution images.

    Add @2x before the file extension on a URL to request an image at double scale

    Thanks, Bob. Looks like that works, although the Horizontal/VerticalResolution needs to be adjusted from 72 to 144. I'll play around with this tomorrow and get the project updated so that it requests the right type of image based on the screen resolution.

  5. Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands
    Edited 2 weeks ago

    @Paul L - why did you chose to have a static picture in a desktop application instead of presenting the map in a html-viewer ? Providing of static pictures is a great option of the Mapbox API, but thought it was more or less meant for reports and documents.

    btw: seems sample application Eddie's Electronics (desktop) has a scope-issue with variable 'invoiceNum' in method 'DeleteInvoiceItems'

  6. Paul L

    Jan 10 Xojo Inc http://docs.xojo.com

    @Joost R why did you chose to have a static picture in a desktop application instead of presenting the map in a html-viewer ? Providing of static pictures is a great option of the Mapbox API, but thought it was more or less meant for reports and documents.

    Previously I had been using JavaScript that I loaded into an HTMLViewer to show a Google Map, but that was causing security issues as most platforms don't want you loading JavaScript that hits external URLs in that way. A static map made more sense to me since it didn't seem like the map needed to be interactive and MapBox had a free API for that. They may also have something for interactive maps, but I was concerned about the same security issues popping up and I wanted to avoid that for this demo.

    @Joost R btw: seems sample application Eddie's Electronics (desktop) has a scope-issue with variable 'invoiceNum' in method 'DeleteInvoiceItems'

    Can you elaborate?

  7. Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands

    @Paul L Can you elaborate?

    -image-

    Demo EEDesktop - just loaded from the Examples-folder and hit Run.

  8. Paul L

    Jan 10 Xojo Inc http://docs.xojo.com

    Weird. I am definitely not seeing that error in 2018r4.

    However, it looks like the "invoiceNum" parameter is already a String so the Str method is not needed there. I'm not sure why it would be causing an error for you, though.

  9. Ulrich B

    Jan 10 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    There were some versions where str(aString) would lead to such an error. What data type is invoiceNum?

  10. Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands

    @Paul L / @Ulrich B

    -image-

    At least on Windows you cannot throw a string into a Str function

    -image-

    So, since invoiceNum is already a of type string , you just should remove the Str here and the problem is fixed.

    And, weird, the documentation says the value of the Str function goes as a variant, but you can only use value types Boolean, Date or Color.

  11. Tim P

    Jan 10 Pre-Release Testers feedback://46303

    This is a great example of why I like variable type prefixing. "invoiceNum" implies that it's a numeric value, but it's a String! Sure it's just a small oversight here, but with a consistent variable naming policy that includes variable type it would have been clear from the start ;)

    It's a good practice to get into the habit of, and may save you some head scratching in larger, non-example projects!

  12. Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands
    Edited 2 weeks ago

    Exactly: sInvoiceNum would be better.

  13. Kem T

    Jan 10 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    With a strongly typed language like Xojo, I think that's unnecessary, inconvenient, and harder to read.

    Just an opposing viewpoint.

  14. brian f

    Jan 10 Pre-Release Testers, Xojo Pro Chilly California
    Edited 2 weeks ago

    @Joost R Exactly: sInvoiceNum would be better.

    DIM ThisReallyIsaStringNotaNumberInvoiceNumber As String :P

  15. Tim P

    Jan 10 Pre-Release Testers feedback://46303
    Edited 2 weeks ago

    @Kem Tekinay With a strongly typed language like Xojo, I think that's unnecessary, inconvenient, and harder to read.

    Unnecessary and inconvinient like your over-spacing around parens? ;)

    @brian f DIM ThisReallyIsaStringNotaNumberInvoiceNumber As String :P

    Better and more descriptive than some of the variable names we see around here :)

    (Style is all opinion! Mine is that type prefixing is super helpful and useful.)

  16. Bob K

    Jan 10 Pre-Release Testers, Xojo Pro Kansas City

    @Kem T With a strongly typed language like Xojo, I think that's unnecessary, inconvenient, and harder to read.

    Just an opposing viewpoint.

    As long as you're consistent and it makes sense to you, your clients not only now but to your future selves then you're good. Also throw in other people that will have to fix something in your code years down the road.

    But, I'd also agree that sInvoiceNum, or some variation thereof, is better because looking strictly at code (not having your mouse over it) it is impossible to tell what invoiceNum is. I like being able to tell at glance what the datatype is. And yes this means if you change it from string to integer for some reason you must change the prefix - it's not that hard - really.

    This is almost religious war material so you be you. Peace.

  17. Kem T

    Jan 10 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    @Bob K This is almost religious war material so you be you.

    "Almost"?

    :P

  18. Ulrich B

    Jan 10 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    @Paul L I'm not sure why it would be causing an error for you, though.

    Because the docs say Str() expects "any numeric, Boolean, Date or Color expression". Which a string is not (necessarily). IMHO the compiler should complain here.

  19. Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands

    Hmm .. it was not my intention to pollute this thread about Maps with a discussion about using prefixes and a bug in demo-code.

    But, since this thread is already far off straight track, I must say I don't like not being able to run a demo program right away without being stopped by compiling issues. Think this demo application was probably not very well tested on the Windows platform. Keep in mind that newbies wouldn't know what to do here.

    Let's close here... summarized I am most happy with the discovery of Mapbox , which is a great free mapping solution.

  20. Ulrich B

    Jan 11 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    @Joost R Think this demo application was probably not very well tested on the Windows platform.

    Let me add one point of self-correction:
    I think I was wrong saying some versions of Xojo show this error.
    Could it be you are using plugins? If I remember correctly, the error does not appear with a clean installation of the IDE.
    And now I am silent here too.

  21. Joost R

    Jan 11 Pre-Release Testers, Xojo Pro The Netherlands

    @Ulrich B Could it be you are using plugins?

    Yes, I have some MBS plugins loaded which fill in what Xojo doesn't provide currently, so no chance to go without. But anyway, this Str function was needles here.

  22. Newer ›

or Sign Up to reply!