New call-to-action
Results 1 to 4 of 4

Thread: 2 xbasic commands that I cannot find in the Help file

  1. #1
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default 2 xbasic commands that I cannot find in the Help file

    Having managed to get Google Static maps up and running (thanks to a helpful posting to the forum) I am now trying to get google streetview working.
    the example code uses

    1) *url_object(url)
    2) ui_bitmap_png_load()

    both used in the following bit of code which is supposed to display streetview at the defined location.
    Code:
    addr = "New York"
    dlg_title = "Testing"
    url="http://maps.googleapis.com/maps/api/streetview?size=600x300&location=40.720032,-73.988354&fov=90&heading=235&pitch=10&sensor=false"
    po=*url_object(url)
    ui_bitmap_png_load("tmp1",po.content)
    ui_modeless_dlg_box(dlg_title,<<%dlg%
    	{position=4,.2}{nocaption}{font=georgia,10,b}
    	{text=60addr};
    	{lf};
    	{image=tmp1}
    %dlg%)
    I cannot seem to get the code to display the correct streetview, all I am getting is a small grey coloured box with the correct heading, but no picture!

    the actual url, if entered in my browser does indeed show the same image as the example in the google map api.
    so is there something wrong with the modeless dlg box code?
    Last edited by Graham Wickens; 10-07-2011 at 05:23 PM. Reason: more information
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: 2 xbasic commands that I cannot find in the Help file

    It appears that the url format is as shown in the example. For instance, this works.

    Code:
    url="http://maps.google.com/maps/api/staticmap?center=Steve+Flanders+Square,Manhattan,NY&zoom=14&size=512x512&maptype=roadmap"+\
    "&markers=color:blue%7Clabel:W%7CSteve+Flanders+Square,Manhattan,NY&sensor=false"
    po=*url_object(url)
    ui_bitmap_png_load("tmp1",po.content)
    ptr = ui_modeless_dlg_box(dlg_title,<<%dlg%
    	{position=4,.2}{nocaption}{font=georgia,10,b}
    	{text=60addr};
    	{lf};
    	{image=tmp1}
    %dlg%)

  3. #3
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: 2 xbasic commands that I cannot find in the Help file

    Yes Stan that does work for Staticmap, I'm having problems with Streetview.
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  4. #4
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: 2 xbasic commands that I cannot find in the Help file

    having investigated further, it seems that the defined URL in Google Streetview returns a jpeg file not PNG as in Google Maps. I have coded a much simpler user function:

    Code:
    FUNCTION google_streetview_custom AS C (mapr AS C, head AS C, size AS C )
    	addr = "Location is "+alltrim(mapr)+" and Heading is "+alltrim(head)
    	url="http://maps.googleapis.com/maps/api/streetview?size="-alltrim(size)-"&location="-alltrim(mapr)-"&fov=90&heading="-alltrim(head)-"&pitch=10&sensor=false"
    	po = *url_object(url)
    	tmp1 = jpeg_to_bitmap(po.content)
    	ui_dlg_box("Street View","{size=4}{position=4,2}{font=georgia,10,b}{text=80addr}{lf}{image=tmp1}")
    END FUNCTION
    the url returns Streetview.jpg

    mapr is map reference example is mapr = s_quote(51.750478)-","-s_quote(-2.235350)
    head is geographic heading, example head = s_quote(145)
    size is size of bitmap in pixels, example size = "400x400"

    these values should give me a view of my House from the road.

    I cannot work out how to get the streetview.jpg file coded in the modeless dialog box, Where would the url store the Jpg or how do I code it please?
    Last edited by Graham Wickens; 10-08-2011 at 08:54 AM. Reason: rewording
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

Similar Threads

  1. New Xbasic commands and enhancements in version 8.
    By Marcel Kollenaar in forum Alpha Five Version 7
    Replies: 1
    Last Post: 11-01-2006, 04:47 AM
  2. Dynamic evaluation of xbasic commands
    By Mike Thomson in forum Alpha Five Version 5
    Replies: 4
    Last Post: 09-16-2005, 01:42 PM
  3. low level Xbasic commands from script recorder
    By oldtony in forum Alpha Five Version 6
    Replies: 2
    Last Post: 01-21-2005, 12:59 PM
  4. Find Record With Xbasic
    By Phil Rolf in forum Alpha Five Version 4
    Replies: 5
    Last Post: 07-06-2001, 05:19 AM
  5. Undocumented Xbasic Commands???
    By Steve Buckler in forum Alpha Five Version 4
    Replies: 2
    Last Post: 04-20-2000, 04:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •