Jump to content


Photo

Google Maps for uniGUI


  • Please log in to reply
424 replies to this topic

#401 devya

devya

    Member

  • Members
  • PipPip
  • 12 posts

Posted 20 October 2017 - 07:58 AM

Dear All,

 

Can teach me how to use this component in UNIGUI, ?

 

1. retrieve the postal code from the address.

2. Calculate the distance between two address.

 

Thanks in advance.


  • 0

Regards,

 

Devy


#402 lema

lema

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts

Posted 20 October 2017 - 05:52 PM

Dear All,

 

Can teach me how to use this component in UNIGUI, ?

 

1. retrieve the postal code from the address.

2. Calculate the distance between two address.

 

Thanks in advance.

 

Hello,

 

1. You can try reverse geocoding.

 

2. Use the included Haversine formula

function TUniGMap.ComputeDistanceBetween(lat1, lng1, lat2, lng2: Double): Double;


  • 0

#403 devya

devya

    Member

  • Members
  • PipPip
  • 12 posts

Posted 21 October 2017 - 01:20 PM

Hello,

 

1. You can try reverse geocoding.

 

2. Use the included Haversine formula

function TUniGMap.ComputeDistanceBetween(lat1, lng1, lat2, lng2: Double): Double;

 

Hi Lema,

 

Thanks, i will try it.


  • 0

Regards,

 

Devy


#404 devya

devya

    Member

  • Members
  • PipPip
  • 12 posts

Posted 21 October 2017 - 01:50 PM

Hi Lema,

 

Thanks, i will try it.

Hi Lema,

 

Can i have the distance matrix function in your componnent ?

 

I need to draw the path from 1 Origin to multi destination from database.


  • 0

Regards,

 

Devy


#405 zemorango

zemorango

    Member

  • uniGUI Subscriber
  • PipPip
  • 38 posts
  • LocationPortugal

Posted 27 October 2017 - 10:49 AM

Hi Lema,

 

when I Compile my projects to 64 bits the UniGmap only shows a white screen. :unsure:

 it runs well on 32 bits but I really need to compile to 64 bits.

I'm using Delphi Berlin update 1 and unigui version


  • 0

#406 lema

lema

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts

Posted 27 October 2017 - 11:03 PM

Hi Lema,

 

when I Compile my projects to 64 bits the UniGmap only shows a white screen. :unsure:

 it runs well on 32 bits but I really need to compile to 64 bits.

I'm using Delphi Berlin update 1 and unigui version

 

Hello,

could you please upload a sample application demonstrating the problem ?


  • 0

#407 zemorango

zemorango

    Member

  • uniGUI Subscriber
  • PipPip
  • 38 posts
  • LocationPortugal

Posted 30 October 2017 - 01:00 PM

Hello,

could you please upload a sample application demonstrating the problem ?

 

Hi Lema, Yes I can, I send you a link, its a simple project

 

https://1drv.ms/u/s!...dsEppJqJX-HktXQ

 

also I have some problems running project as ISAP dll published to IIS, even in 32 bits I get a white screen instead of the map,

I tested you demo project and have the same problem

I sent you some pictures in the links below

 

https://1drv.ms/i/s!...b_Zo6gft6UK-CBA

 

https://1drv.ms/i/s!...c4_Dw7spMS3ze3g

 

 

 

 

 


  • 0

#408 lema

lema

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts

Posted 31 October 2017 - 05:14 AM

Hi Lema, Yes I can, I send you a link, its a simple project

 

https://1drv.ms/u/s!...dsEppJqJX-HktXQ

 

also I have some problems running project as ISAP dll published to IIS, even in 32 bits I get a white screen instead of the map,

I tested you demo project and have the same problem

I sent you some pictures in the links below

 

https://1drv.ms/i/s!...b_Zo6gft6UK-CBA

 

https://1drv.ms/i/s!...c4_Dw7spMS3ze3g

 

Hello, did you set your own Google API Key ?
(The corresponding constant is MyGoogleAPIKey)

You can get your key at https://code.google.com/apis/console/

 


  • 0

#409 tjpr87

tjpr87

    Newbie

  • Members
  • Pip
  • 4 posts
  • LocationPortugal

Posted 06 November 2017 - 05:59 PM

Hi Renato.

Now I see that you didn't include the required files

/../files/uniGmap.css
/../files/markerwithlabel_packed.js
/../files/markerclusterer_compiled.js
 

Please add them in the corresponding folder and try again.

Your anwser saved me :D

Thanks a lot.


  • 0

#410 deljavan

deljavan

    Member

  • uniGUI Subscriber
  • PipPip
  • 26 posts

Posted 12 November 2017 - 04:58 AM

Hi lema

I use unimgmap. Interestingly, The map is loaded and sometimes the map is not loaded
It does not know exactly why.
Where do I make a mistake?
please guide me ...
Thanks

Attached Files


  • 0

#411 birog

birog

    Newbie

  • uniGUI Subscriber
  • Pip
  • 2 posts

Posted 14 November 2017 - 05:53 PM

Great component.
Thank you so much

  • 0

#412 birog

birog

    Newbie

  • uniGUI Subscriber
  • Pip
  • 2 posts

Posted 14 November 2017 - 08:18 PM

Hi Lema,
 
after installing version 1.4.8 (with unigui Pro uni-1.0.0.1403), the route function displays an error and does not work.
The error also comes with uniGMap Demo (I've compiled on my PC)
If I open the DIRECTIONS example and click on GO, the application shows a script error with the "Unexpected string" message and the following text:
 
MarkerClusterer_OE4.clearMarkers();for ( var i=0; i<markersArray_OE4.length; i++ ) {google.maps.event.clearInstanceListeners(markersArray_OE4[i]);markersArray_OE4[i].setMap(null); } markersArray_OE4.length = 0;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                   : "Brussel",   destination              : "Maastricht",   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_OE4);  } 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(OE4, "directions_changed",     ["count=" + my.routes[0].legs[0].steps.length ,     "directionsDisplay=" + JSON.stringify(data)     "directionsRoutes=" + JSON.stringify(directionsDisplay.getDirections(), null, "\t")     ]); });
 
 
If I reinstall the version 1.4.6 everything will return to work perfectly.

 
Where am I wrong?
 
Thank you

 


  • 0

#413 bbm

bbm

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 88 posts
  • LocationGermany

Posted 22 November 2017 - 11:37 AM

Hi,

 

is the any way to get the lat and lng of a special address like zip+street+city?

 

best regards


  • 0

#414 lema

lema

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts

Posted 24 November 2017 - 01:35 PM

 

Hi lema

I use unimgmap. Interestingly, The map is loaded and sometimes the map is not loaded
It does not know exactly why.
Where do I make a mistake?
please guide me ...
Thanks

 

 

Hello,

could you please upload a sample application demonstrating the problem ?

 

 

Also, check at this:

http://forums.unigui...e-20#entry46531


  • 0

#415 lema

lema

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts

Posted 24 November 2017 - 01:44 PM

 

Hi Lema,
 
after installing version 1.4.8 (with unigui Pro uni-1.0.0.1403), the route function displays an error and does not work.
The error also comes with uniGMap Demo (I've compiled on my PC)
If I open the DIRECTIONS example and click on GO, the application shows a script error with the "Unexpected string" message and the following text:
 
....
 
If I reinstall the version 1.4.6 everything will return to work perfectly.

 
Where am I wrong?
 
Thank you

 

 

Hello,

please double check that the Google Maps Directions API in your Google API Key is enabled.


  • 0

#416 deljavan

deljavan

    Member

  • uniGUI Subscriber
  • PipPip
  • 26 posts

Posted 03 December 2017 - 05:00 AM

Hello,

could you please upload a sample application demonstrating the problem ?

 

 

Also, check at this:

http://forums.unigui...e-20#entry46531

Attached Files


  • 0

#417 lema

lema

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 353 posts

Posted 03 December 2017 - 06:58 PM

 

Hello,

could you please upload a sample application demonstrating the problem ?

 

 

Also, check at this:

http://forums.unigui...e-20#entry46531

 

 

Hello, the sample seems to work fine on my end with:

Delphi Seattle

UniGUI 1.0.0.1413 Complete

 

 

Do you have problem with the specific project?


  • 0

#418 dan602

dan602

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 68 posts

Posted 21 January 2018 - 09:31 PM

**EDIT** Sorted myself - skip to end for answer.

 

Hi Lema,

 

Firstly thanks for the component, post card will be in the post soon!

 

Just one issue - I use SSL (https) from a a IIS ISAPI dll - the only way I can get it to work is to allow the site to 'load scripts from unauthorized sources'. Doing this makes my 'secure' site 'unsecure'

 

The only method I call is UniGMap1.Geocoding('valid address', true); 

 

I guess the component loads the google library using http, not https - is their anything I can do about this? tell the component to load it from a https source?

 

If i do not allow 'load scripts from unauthorized sources' I get 'google is not defined' - as the library is obviously not loaded.

 

Can I override the path for http://maps.googleap...allback=initMap

to

https://maps.googlea...allback=initMap somehow?

 

 

**EDIT**  I thought Adding https://maps.googlea...allback=initMap  to CustomFiles in ServerModule, might help, but it does not - I still get the complaint of 'This page is trying to load scripts from unauthenticated sources' - So it must be something to do with where the script is being loaded from. (i think) 

 

This is what I get if I load scripts from 'unauthorized sources' https://www.dropbox....21_23-17-55.png If I allow the script to run everything works as expected.

 

 

Any ideas?

 

**EDIT** I have just found the maps api URL in GMaps.pas constructor, doh!!!

 

Left here in case anyone else has the issue and doesn't check in the most obvious place first!!


  • 0

#419 picyka

picyka

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 77 posts

Posted 29 January 2018 - 01:04 AM

Hello, did anyone get to use the mapdblclick and mapclick events on the mobile at the same time? always triggers only the mapclick event.

 

Google Translate.

Hello, did anyone get to use the mapdblclick and mapclick events on the mobile at the same time? always triggers only the mapclick event


  • 0

#420 picyka

picyka

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 77 posts

Posted 29 January 2018 - 06:37 PM

Has anyone gone through this?


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users