patmap Posted July 21, 2011 Posted July 21, 2011 Hi, How can i use Google Map in uniGUI. Can you put a sample in this topic? Thank you Best Regards Quote
Harry Rogers Posted July 21, 2011 Posted July 21, 2011 I use the 'Static Map' API to display a map whilst browsing through a table/query containing postcode data. A TuniUrlFrame (urlMap below) takes care of the drawing. 2 checkboxes (chkRoad, chkSat) allow the user to select the type of view procedure TfrmCustBrow.drawmap(centre,zoom : string); var imgW,imgH, MapType : string; begin imgW := inttostr(urlMap.width); imgH := inttostr(urlMap.height); if (chkRoad.Checked) and (chkSat.Checked) then MapType := 'hybrid' else if chkRoad.Checked then MapType := 'roadmap' else if chkSat.Checked then Maptype := 'satellite' else Maptype := 'terrain'; urlMap.URL := 'http://maps.google.co.uk/maps/api/staticmap?center=' + Custpcode + '&zoom=' + zoom + '&size=' + imgW +'x'+ imgH +'&maptype=' + MapType + '&sensor=false&markers=color:Red|' + Custpcode; end; Zoom is controlled by a TUniTrackBar procedure TfrmCustBrow.trckZoomChange(Sender: TObject); begin drawmap(custPcode,inttostr(trckZoom.position)); end; For more functionality - like routeing I use a full URLwindow (frmMap1 in the example) display with a start address (sStartAdd) and destination address (custPcode) defined Procedure TfrmCustBrow.btnMapClick(Sender: TObject); begin with frmMap1 do begin urlframe.URL := 'http://maps.google.com/maps?saddr=' + sStartAdd + '&daddr=' + custPcode; show; end; end; I expect lots of clever stuff is possible using the full mapping API but these 2 methods provide some useful stuff and are very easy to implement. - Google do impose a 'fair usage' limit on the Static API calls. If you have 10000 postcodes and browse up and down the list plotting each in turn you will find they stop providing data for a bit. Hope this helps Quote
patmap Posted July 21, 2011 Author Posted July 21, 2011 Hi, Thank you HarryG for your answer, This is good for putting Google Map in Frame, very good idea. But how can i use Google Maps futures!? Such as: Add Marker, Add Line, Get Zoomed Event, ... Thank you very much again for answering. Best Regards Babak Yaghoobi Quote
Harry Rogers Posted July 21, 2011 Posted July 21, 2011 Sorry but I have not had a look at anything more advanced than this so far. Quote
Administrators Farshad Mohajeri Posted July 21, 2011 Administrators Posted July 21, 2011 I next build I will add a Google maps demo based on TUniHTMLFrame. Quote
patmap Posted July 21, 2011 Author Posted July 21, 2011 I next build I will add a Google maps demo based on TUniHTMLFrame. Very Very Thank you Mr. Farshad. Please add DrawLine and AddMarker with Marker ID for moving markers on map. Thank again. Best Regards Babak Yaghoobi Quote
Administrators Farshad Mohajeri Posted July 21, 2011 Administrators Posted July 21, 2011 I will try to demonstrate general usage of Google maps. Developers should explore Google maps API for advanced usage and possible interaction with uniGUI elements. Quote
patmap Posted July 21, 2011 Author Posted July 21, 2011 Hi Mr. Farshad I write in JavaScript meny future OF Google Map, but i dont know how can i use in uniGUI, and how can i send command to JavaScript i attached Google Map AddMarker and Drawing API. Best Regards JGMain.zip Quote
patmap Posted July 21, 2011 Author Posted July 21, 2011 Hi, The offical site have Google Map Demo with AddMarker, ... http://dev.sencha.com/deploy/ext-4.0.2a/examples/window/gmap.html Best Regards Quote
Administrators Farshad Mohajeri Posted July 21, 2011 Administrators Posted July 21, 2011 That's an Ext JS 4 example but I'll look at it. Thx Quote
patmap Posted July 21, 2011 Author Posted July 21, 2011 Hi, Mr. Farshad This is the best Class for display Google Map with many futures: addMarker, addMarkers, addPolyline, createInfoWindow, clearMarkers, showMarkers, hideMarkers, addMapControls, getCenter and Events: onMapReady, onResize https://github.com/V...JS.ux.GMapPanel This project have a two file Ext.ux.GMapPanel.js and Ext.ux.GMapPanel3.js that Ext.ux.GMapPanel3.js file work with Ext.3.3 Thank you Best Regards Quote
Administrators Farshad Mohajeri Posted July 21, 2011 Administrators Posted July 21, 2011 Well, I will not add a full featured Google Maps component. It is beyond our scope. In future we may add such components but for now we need to take care of more important tasks. Google maps is one of hundreds of things that can be done on client side using Ext JS and client events. I will try to create a demo and leave the rest of exercise to the developers. Quote
patmap Posted July 22, 2011 Author Posted July 22, 2011 Hi, If you will give us a base class for develope uniGUI components we help you for develope meny components and add in uniGUI and share with other developers.( Such as Delphi ) Thank you, Best Regards Quote
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.