Hello all,
Inspired by previous implementations of the jQuery Color Picker and Date Picker I am trying to implement a google map picker for a store locator.
I am using: http://www.wimagguc.com/projects/jquery ... ker-gmaps/
But have it as an addon called gmap-picker (which contains the css and js) then I cam calling it into a message field like the previous examples. I've got it working to the extent it shows in the Couch CMS and updates the default fields for long and lat when you drag, however those fields are inside the "Message" editable therefore I created two new fields called to save the data - however these are not been updated / taking the drag values and it seems the inclusions of the dependent scripts is disabling the "save" button for couch.
This is my store-locator.php
NOTE: I have modified the jquery-gmaps-latlon-picker.js so it references the ID (rather than class) of:
f_gllpLatitude
and
f_gllpLongitude
in order to work with :
but it's not working
Any help would be greatly appreciated.
Attached is the store-locator.php and the addon folder zipped (which includes the modified picker js)
BTW - there are a few implementation options for that original script, I have chosen to store Long and Lat because it will allow me to output multiple markers into a google map on the site front end once I get that far. A simpler output would use a single "address" text input then clean that up to pass into a URL string to load the map, but only for a single map - therefore I think Long and Lat a better option (more flexible).
If I get it working, once I have the front end output of "Stores" on a google map with infobox and link to single store page, I will release the full working code to the forums for other Couchers.
Inspired by previous implementations of the jQuery Color Picker and Date Picker I am trying to implement a google map picker for a store locator.
I am using: http://www.wimagguc.com/projects/jquery ... ker-gmaps/
But have it as an addon called gmap-picker (which contains the css and js) then I cam calling it into a message field like the previous examples. I've got it working to the extent it shows in the Couch CMS and updates the default fields for long and lat when you drag, however those fields are inside the "Message" editable therefore I created two new fields called to save the data - however these are not been updated / taking the drag values and it seems the inclusions of the dependent scripts is disabling the "save" button for couch.
This is my store-locator.php
- Code: Select all
<?php require_once 'couch/cms.php'; ?>
<cms:template title='Store Locator' clonable='1' commentable='0' dynamic_folders='1'>
<cms:editable name='google_map' type='message'>
<!-- Dependencies: JQuery and GMaps API should be loaded first -->
<script src="<cms:show k_couch_link />addons/gmap-picker/jquery-1.7.2.min.js"></script>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<!-- CSS and JS for our code -->
<link rel="stylesheet" type="text/css" href="<cms:show k_couch_link />addons/gmap-picker/jquery-gmaps-latlon-picker.css"/>
<script src="<cms:show k_couch_link />addons/gmap-picker/jquery-gmaps-latlon-picker.js"></script>
<fieldset class="gllpLatlonPicker">
<input type="text" class="gllpSearchField">
<input type="button" class="gllpSearchButton" value="search">
<br/><br/>
<div class="gllpMap">Google Maps</div>
<br/>
lat/lon:
<input type="text" id="f_gllpLatitude" value="20"/>
/
<input type="text" id="f_gllpLongitude" value="20"/>
<input type="button" class="gllpUpdateButton" value="update map">
</fieldset>
</cms:editable>
<cms:editable name='gllpLatitude' type='text' />
<cms:editable name='gllpLongitude' type='text' />
</cms:template>
<?php COUCH::invoke(); ?>
NOTE: I have modified the jquery-gmaps-latlon-picker.js so it references the ID (rather than class) of:
f_gllpLatitude
and
f_gllpLongitude
in order to work with :
- Code: Select all
<cms:editable name='gllpLatitude' type='text' />
<cms:editable name='gllpLongitude' type='text' />
but it's not working

Any help would be greatly appreciated.
Attached is the store-locator.php and the addon folder zipped (which includes the modified picker js)
BTW - there are a few implementation options for that original script, I have chosen to store Long and Lat because it will allow me to output multiple markers into a google map on the site front end once I get that far. A simpler output would use a single "address" text input then clean that up to pass into a URL string to load the map, but only for a single map - therefore I think Long and Lat a better option (more flexible).
If I get it working, once I have the front end output of "Stores" on a google map with infobox and link to single store page, I will release the full working code to the forums for other Couchers.