cristianotestai Posted November 27, 2014 Share Posted November 27, 2014 Hello, Anyone know how to use the Google Maps to do for example: I have a contact list categorized by neighborhood or street and would like to display on the map all my contacts that are of particular street or neighborhood of a city. What I need is to have a view on a map indicating the contacts, and hover at some point, show the contact name for example. Someone already did something similar or have any idea perhaps using the UniGmap? Thanks. Quote Link to comment Share on other sites More sharing options...
lema Posted November 28, 2014 Share Posted November 28, 2014 Hello. I am doing something similar using uniGMap and its markers' functionality. http://forums.unigui.com/index.php?/topic/2363-google-maps-for-unigui/ e.g. procedure TmyForm.UniButton1Click(Sender: TObject); var aMarker: TMarker; i: integer; begin for i := 1 to 50 do begin with aMarker do begin id := i; Latitude := random(150) - 75; Longitude := random(360) - 180; title := format('Marker %d', [i]); animation := maNone; clickable := True; draggable := False; raiseOnDrag := False; AddToCluster := True; end; UniGMap1.AddMarker(aMarker); end; end; 1 Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted December 3, 2014 Author Share Posted December 3, 2014 Hi Lema, I will try to do according to my need, and then I post the result. Thanks, Cristiano Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted December 16, 2014 Author Share Posted December 16, 2014 Hello. I am doing something similar using uniGMap and its markers' functionality. http://forums.unigui.com/index.php?/topic/2363-google-maps-for-unigui/ e.g. procedure TmyForm.UniButton1Click(Sender: TObject); var aMarker: TMarker; i: integer; begin for i := 1 to 50 do begin with aMarker do begin id := i; Latitude := random(150) - 75; Longitude := random(360) - 180; title := format('Marker %d', [i]); animation := maNone; clickable := True; draggable := False; raiseOnDrag := False; AddToCluster := True; end; UniGMap1.AddMarker(aMarker); end; end; Hi Lema, To search the data and create the marks on the map, you store in the database the Latitude and Longitude information of each location, or at runtime, you search on Google API this information regarding the address to create the marks? Regards, Cristiano Testai Brazil Quote Link to comment Share on other sites More sharing options...
lema Posted December 16, 2014 Share Posted December 16, 2014 Hello, I store in the database the Latitude and Longitude of each point. Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted December 17, 2014 Author Share Posted December 17, 2014 Hello Lema! My table has the following fields, for example: Name, Address, City, State or Province, Latitude, Longitude. I have some questions about the best way to store the Latitude and Longitude: 1) At the moment of Insert, before storing in the database, I must make a call to the Google Maps API to get the Latitude and Longitude registry, to store in the table, right? So, how to handle, if the user only informed the Address without informing the city or state? Or if he only informed the City, without informing the address? I ask these questions because it is not necessarily required to inform the full address. 2) In each update of a record, I'll need to monitor if there was a change in one of the above fields to again call the API to get the latitude and longitude and update the registry. This is the best or only way to achieve? Thanks for your comment. Quote Link to comment Share on other sites More sharing options...
lema Posted December 17, 2014 Share Posted December 17, 2014 Hello Lema! My table has the following fields, for example: Name, Address, City, State or Province, Latitude, Longitude. I have some questions about the best way to store the Latitude and Longitude: 1) At the moment of Insert, before storing in the database, I must make a call to the Google Maps API to get the Latitude and Longitude registry, to store in the table, right? So, how to handle, if the user only informed the Address without informing the city or state? Or if he only informed the City, without informing the address? I ask these questions because it is not necessarily required to inform the full address. 2) In each update of a record, I'll need to monitor if there was a change in one of the above fields to again call the API to get the latitude and longitude and update the registry. This is the best or only way to achieve? Thanks for your comment. Geocoding is not always accurate for partial addresses. This is a problem without solution for all of us who trying to show POIs on a map. I really don't have something to suggest except to ask from user to type a well-formed address like "Delphi, 330 54, Phocis, Greece" Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted January 6, 2015 Author Share Posted January 6, 2015 Hi Lema and All, Thanks for comment .. really, the user must enter a well-formed address. I have other situation: In the demo UniGMap component, is shown the use of Labels for Marks on Map where you can associate a CSS style or CSS class. It is possible to create a more elegant panel for the mark on the map as can be seen in the attached image? I need that when the user clicks on the mark, a panel with some information (similar to the example image) are presented as used by Google Maps. Could you indicate if possible, how to perform the effect i need? Thanks! Quote Link to comment Share on other sites More sharing options...
lema Posted January 6, 2015 Share Posted January 6, 2015 Hello ! You could use the marker click event to show a unigui form. Regarding CSS and HTML , I will take a look at it once I have access to my PC. Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted January 6, 2015 Author Share Posted January 6, 2015 Hi Lema! I plan to have a clean panel with the name in bold, the address with normal font below and below a link to the contact page. I believe that with CSS would be more elegant than create its own form just for this, more i'm not sure how to accomplish this with UniGmap component. In the image of the previous post, shows just how I like to have the information. Thank you in advance. Best Regards. 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.