EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: peter900 on April 21, 2016, 03:06:52 AM



Title: Display Google Map in pop-up using datagrid row for co-ordinates
Post by: peter900 on April 21, 2016, 03:06:52 AM
This post http://www.jeasyui.com/forum/index.php?topic=1559.0 (http://www.jeasyui.com/forum/index.php?topic=1559.0)  shows how to place a Google Map in a Tab.  It has fixed lat. and long. but it should be possible to pull this from a database and convert to JSON to display varying map positions.

The CRUD example illustrates how to  get data from a db, load the grid and then, via buttons, display the data in a pop-up form.

I'd like to mirror this with a Google map.  So the user selects a row and clicks a button Refresh Map - this passes the lat. and long. to the pop-up and so causes the map to refresh. The pop-up is non-modal so the user can switch between the form and the map.

Does this sound possible ?  Am I going in the right direction ?   Has anyone done this ?   Any help or suggestions much appreciated !


Title: Re: Display Google Map in pop-up using datagrid row for co-ordinates
Post by: peter900 on April 24, 2016, 03:04:06 PM
I have a working version of this - see http://www.marionandpeter.com/XeroDev1/?page_id=97  (http://www.marionandpeter.com/XeroDev1/?page_id=97)

This Google tutorial  https://developers.google.com/maps/articles/phpsqlsearch_v3 (https://developers.google.com/maps/articles/phpsqlsearch_v3) provided working code to generate the xml from a MySQL table holding lat and long data. This is displayed in a Data Grid for which the usual CRUD facilities are provided.  Selecting a row in the grid updates the map via Ajax.

It needs a bit of tidying up but the the grid, the data maintenance form and the map sit nicely in an iFrame on a Drupal web page.  There are Ajax pop-ups available in Drupal and in theory these can be linked to Drupal views but my present view is the easyui route is more straightforward.