Jump to content


Photo

Google Maps for uniGUI


  • Please log in to reply
424 replies to this topic

#421 morphine

morphine

    Member

  • uniGUI Subscriber
  • PipPip
  • 13 posts

Posted 30 January 2018 - 04:57 PM

Hi All,

 

Is there a way to install the component for Delphi XE ? I noticed there is no .dpk  file for Delphi XE.

 

Thanks.


  • 0

#422 zanona

zanona

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 71 posts

Posted 03 February 2018 - 11:10 AM

When I use HTTPS it gives the error below when using the component! If only used as normal HTTP works! What could it be?

 

Source

 

    UniGMap1.RemoveAllRoutes;
 
    with DirectionsRequest do
    begin
      origin := 'rua amadeu perin, 200 colombo, pr';
      destination := 'curitiba, pr';
      travelMode := tmDRIVING;
      draggable := True;
      waypoints := '';
    end;
 
    UniGMap1.Route(DirectionsRequest);

 

Error:

 

ajaxRequest(O6D,"resize",["w="+O6D.getWidth(),"h="+O6D.getHeight()]);if(Ext.Msg.isVisible())Ext.Msg.toFront();if (typeof directionsDisplay != "undefined") {  directionsDisplay.setMap(null);};var rendererOptions = {draggable: true};directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);var directionsService = new google.maps.DirectionsService();  var request = {   origin                   : "rua amadeu perin, 56 colombo, pr",   destination              : "curitiba, pr",   travelMode               : google.maps.DirectionsTravelMode.DRIVING,   unitSystem               : google.maps.UnitSystem.METRIC,   waypoints                : [],   avoidHighways            : false,   provideRouteAlternatives : false,   avoidTolls               : false};  directionsService.route(request, function(response, status){  if ( status == google.maps.DirectionsStatus.OK ) {    directionsDisplay.setDirections(response);    directionsDisplay.setMap(gm_O31);  } else {alert(status);}});  google.maps.event.addListener(directionsDisplay, "directions_changed", function() {  var steps = [];  var wp    = [];  var my    = directionsDisplay.getDirections();   var data  = {};  data.copyrights     = my.routes[0].copyrights;  data.distancetext   = my.routes[0].legs[0].distance.text;  data.distancevalue  = my.routes[0].legs[0].distance.value;  data.durationtext   = my.routes[0].legs[0].duration.text;  data.durationvalue  = my.routes[0].legs[0].duration.value;  data.startaddress   = my.routes[0].legs[0].start_address;  data.endaddress     = my.routes[0].legs[0].end_address;  data.startlocation  = {"lat": my.routes[0].legs[0].start_location.lat(),"lng":my.routes[0].legs[0].start_location.lng()};  data.endlocation    = {"lat": my.routes[0].legs[0].end_location.lat(),"lng":my.routes[0].legs[0].end_location.lng()};  for ( var i=0; i < my.routes[0].legs[0].steps.length; i++) {    steps.push({      "enc_lat_lngs"   : my.routes[0].legs[0].steps[i].encoded_lat_lngs,      "instructions"   : my.routes[0].legs[0].steps[i].instructions,      "distancetext"   : my.routes[0].legs[0].steps[i].distance.text,      "distancevalue"  : my.routes[0].legs[0].steps[i].distance.value,      "durationtext"   : my.routes[0].legs[0].steps[i].duration.text,      "durationvalue"  : my.routes[0].legs[0].steps[i].duration.value,      "startlocation"  : {"lat": my.routes[0].legs[0].steps[i].start_location.lat(),"lng": my.routes[0].legs[0].steps[i].start_location.lng()},      "endlocation"    : {"lat": my.routes[0].legs[0].steps[i].end_location.lat(),"lng": my.routes[0].legs[0].steps[i].end_location.lng()}    });  }  data.steps = steps;  for ( var i=0; i < my.routes[0].legs[0].via_waypoints.length; i++) {      wp.push({"location" : my.routes[0].legs[0].via_waypoints[i].lat() + "," + my.routes[0].legs[0].via_waypoints[i].lng() });  }  data.waypoints = wp;  ajaxRequest(O31, "directions_changed",     ["count=" + my.routes[0].legs[0].steps.length ,     "directionsDisplay=" + JSON.stringify(data)     ]); });if (navigator.geolocation) {   navigator.geolocation.getCurrentPosition( function(position) {     ajaxRequest(MainForm.btLocation, "CurrentPosition" ,      ["lat=" + position.coords.latitude,        "lng=" + position.coords.longitude,        "acc=" + position.coords.accuracy,        "alt=" + position.coords.altitude,        "altacc=" + position.coords.altitudeAccuracy,        "head=" + position.coords.heading,        "ts=" + position.coords.timestamp       ]);    })};


  • 0

#423 zanona

zanona

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 71 posts

Posted 03 February 2018 - 11:35 AM

I found the solution! Switch HTTP to HTTPS on component!
 
url: = 'https://maps.googlea...ps/api/js?key='+ MyGoogleAPIKey + '& libraries = geometry, places, visualization & sensor = false';

  • 0

#424 DarkDudae

DarkDudae

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 15 February 2018 - 07:52 AM

Hello lema:

 

There is a bug with clusters and markersEx due to recent google maps API changes.

Now, the clusters won´t appear and a Ajax error pops: "Cannot read property 'removeChild' of null"

You can open your own online demo and click the button: "Marker Clusterer", and then, click the "Add markersEx" and the error will show up.

 

Greetings


  • 0

#425 isam

isam

    Member

  • Members
  • PipPip
  • 11 posts

Posted 22 February 2018 - 02:18 PM

hello , i use  uniGMap component V 1.4.8 it is greate job thanks ... but when i wan create marker  i get exeption Acces violation at adresse 040BE4E ...

this is my code :

 

 

procedure TF_Gmap.UniButton1Click(Sender: TObject);

var lng , lat : real;
begin
DTM.Vehicule.First;
lat := 0;
lng := 0;
while Not DTM.Vehicule.Eof do
  begin
   with MarkersEx[DTM.VehiculeRECORDID.Value] do
                begin
                  id := DTM.VehiculeRECORDID.Value;
                  Latitude := 36.733924 - lat;
                  Longitude := 3.274754 + lng;
                  labelAnchor.X := 50;
                  labelAnchor.Y := 50;
                  labelClass := 'myLabel';
                  labelContent := DTM.VehiculeALIAS.Text;
                  labelAnchor.X := 50;
                  labelAnchor.Y := 50;
                  clickable := true; /// a enlevé
                  draggable := True; /// a enlevé
                  labelInBackground := False;
                  labelVisible := True;
                  labelStyle := '{ opacity: 0.50 , color: "green" , width: "150px" }';
                  icon := '/files/images/45.png';
                end;
                UniGMap1.AddMarkerEx(MarkersEx[DTM.VehiculeRECORDID.Value], True);
                lat := 0.36271281838859;
                lng := 0.003004074096709;
    DTM.Vehicule.Next;
  end;
end;
 
 

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users