Jump to content

Streetview in TUniGMap


gschoon

Recommended Posts

Hi,

 

Firstly need to analyze this link:

https://developers.google.com/maps/documentation/javascript/streetview

 

1. Open this demo "..\FMSoft\Framework\uniGUI\Demos\Desktop\GoogleMaps"

 

2. For now "static" example:

procedure TMainForm.SetCoord(Lat, Long : Real);
begin
  if WebMode then
    UniSession.AddJS('var gm=googleMap;if (typeof gm=="object") {gm.setCenter(new google.maps.LatLng('+
                        StringReplace(Format('%2.4f', [Lat]), ',', '.', [rfReplaceAll])+','+
                        StringReplace(Format('%2.4f', [Long]), ',', '.', [rfReplaceAll])+
                      ')); gm.setZoom(8);'+
                      'var panorama = new google.maps.StreetViewPanorama('+
                      'document.getElementById("pano"), {'+
                      'position: {lat: 42.345573, lng: -71.098326},'+
                      'pov: {'+
                      'heading: 34,'+
                      'pitch: 10'+
                      '}'+
                      '});'+
                      'gm.setStreetView(panorama);'+


                      '}');
end;

3. UniHTMLFrame2.HTML:

<div id="pano" style="width: 100%; height: 100%">
</div>

Result:

post-906-0-46809100-1475117648_thumb.png

 

Best regards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...