devya Posted October 20, 2017 Share Posted October 20, 2017 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. Quote Link to comment Share on other sites More sharing options...
lema Posted October 20, 2017 Author Share Posted October 20, 2017 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; Quote Link to comment Share on other sites More sharing options...
devya Posted October 21, 2017 Share Posted October 21, 2017 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. Quote Link to comment Share on other sites More sharing options...
devya Posted October 21, 2017 Share Posted October 21, 2017 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. Quote Link to comment Share on other sites More sharing options...
zemorango Posted October 27, 2017 Share Posted October 27, 2017 Hi Lema, when I Compile my projects to 64 bits the UniGmap only shows a white screen. 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 Quote Link to comment Share on other sites More sharing options...
lema Posted October 27, 2017 Author Share Posted October 27, 2017 Hi Lema, when I Compile my projects to 64 bits the UniGmap only shows a white screen. 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 ? Quote Link to comment Share on other sites More sharing options...
zemorango Posted October 30, 2017 Share Posted October 30, 2017 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!Armx7bQj2c-RiNodsEppJqJX-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!Armx7bQj2c-RiNob_Zo6gft6UK-CBA https://1drv.ms/i/s!Armx7bQj2c-RiNoc4_Dw7spMS3ze3g Quote Link to comment Share on other sites More sharing options...
lema Posted October 31, 2017 Author Share Posted October 31, 2017 Hi Lema, Yes I can, I send you a link, its a simple project https://1drv.ms/u/s!Armx7bQj2c-RiNodsEppJqJX-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!Armx7bQj2c-RiNob_Zo6gft6UK-CBA https://1drv.ms/i/s!Armx7bQj2c-RiNoc4_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/ Quote Link to comment Share on other sites More sharing options...
TRodrigues Posted November 6, 2017 Share Posted November 6, 2017 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 Thanks a lot. Quote Link to comment Share on other sites More sharing options...
deljavan Posted November 12, 2017 Share Posted November 12, 2017 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 Movie.rar Quote Link to comment Share on other sites More sharing options...
birog Posted November 14, 2017 Share Posted November 14, 2017 Great component. Thank you so much Quote Link to comment Share on other sites More sharing options...
birog Posted November 14, 2017 Share Posted November 14, 2017 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);markersArray_OE4.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.encoded_lat_lngs, "instructions" : my.routes[0].legs[0].steps.instructions, "distancetext" : my.routes[0].legs[0].steps.distance.text, "distancevalue" : my.routes[0].legs[0].steps.distance.value, "durationtext" : my.routes[0].legs[0].steps.duration.text, "durationvalue" : my.routes[0].legs[0].steps.duration.value, "startlocation" : {"lat": my.routes[0].legs[0].steps.start_location.lat(),"lng": my.routes[0].legs[0].steps.start_location.lng()}, "endlocation" : {"lat": my.routes[0].legs[0].steps.end_location.lat(),"lng": my.routes[0].legs[0].steps.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.lat() + "," + my.routes[0].legs[0].via_waypoints.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 Quote Link to comment Share on other sites More sharing options...
bbm Posted November 22, 2017 Share Posted November 22, 2017 Hi, is the any way to get the lat and lng of a special address like zip+street+city? best regards Quote Link to comment Share on other sites More sharing options...
lema Posted November 24, 2017 Author Share Posted November 24, 2017 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.com/index.php?/topic/2363-google-maps-for-unigui/page-20&do=findComment&comment=46531 Quote Link to comment Share on other sites More sharing options...
lema Posted November 24, 2017 Author Share Posted November 24, 2017 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. Quote Link to comment Share on other sites More sharing options...
deljavan Posted December 3, 2017 Share Posted December 3, 2017 Hello, could you please upload a sample application demonstrating the problem ? Also, check at this: http://forums.unigui.com/index.php?/topic/2363-google-maps-for-unigui/page-20&do=findComment&comment=46531 Project1111111.rar Quote Link to comment Share on other sites More sharing options...
lema Posted December 3, 2017 Author Share Posted December 3, 2017 Hello, could you please upload a sample application demonstrating the problem ? Also, check at this: http://forums.unigui.com/index.php?/topic/2363-google-maps-for-unigui/page-20&do=findComment&comment=46531 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? Quote Link to comment Share on other sites More sharing options...
Wicket Posted January 21, 2018 Share Posted January 21, 2018 **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.googleapis.com/maps/api/js?key=[API_KEY]&callback=initMap to https://maps.googleapis.com/maps/api/js?key=[API_KEY]&callback=initMap somehow? **EDIT** I thought Adding https://maps.googleapis.com/maps/api/js?key=[API_KEY]&callback=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.com/s/0tw4mliqdw6f9y7/2018-01-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!! Quote Link to comment Share on other sites More sharing options...
picyka Posted January 29, 2018 Share Posted January 29, 2018 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 Quote Link to comment Share on other sites More sharing options...
picyka Posted January 29, 2018 Share Posted January 29, 2018 Has anyone gone through this? Quote Link to comment Share on other sites More sharing options...
morphine Posted January 30, 2018 Share Posted January 30, 2018 Hi All, Is there a way to install the component for Delphi XE ? I noticed there is no .dpk file for Delphi XE. Thanks. Quote Link to comment Share on other sites More sharing options...
zanona Posted February 3, 2018 Share Posted February 3, 2018 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.encoded_lat_lngs, "instructions" : my.routes[0].legs[0].steps.instructions, "distancetext" : my.routes[0].legs[0].steps.distance.text, "distancevalue" : my.routes[0].legs[0].steps.distance.value, "durationtext" : my.routes[0].legs[0].steps.duration.text, "durationvalue" : my.routes[0].legs[0].steps.duration.value, "startlocation" : {"lat": my.routes[0].legs[0].steps.start_location.lat(),"lng": my.routes[0].legs[0].steps.start_location.lng()}, "endlocation" : {"lat": my.routes[0].legs[0].steps.end_location.lat(),"lng": my.routes[0].legs[0].steps.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.lat() + "," + my.routes[0].legs[0].via_waypoints.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 ]); })}; Quote Link to comment Share on other sites More sharing options...
zanona Posted February 3, 2018 Share Posted February 3, 2018 I found the solution! Switch HTTP to HTTPS on component! url: = 'https://maps.googleapis.com/maps/api/js?key='+ MyGoogleAPIKey + '& libraries = geometry, places, visualization & sensor = false'; Quote Link to comment Share on other sites More sharing options...
DarkDudae Posted February 15, 2018 Share Posted February 15, 2018 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 2 Quote Link to comment Share on other sites More sharing options...
isam Posted February 22, 2018 Share Posted February 22, 2018 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.