Tagged: custom fields, google map, maps
- This topic has 8 replies, 6 voices, and was last updated 6 years ago by
helmiaditya14.
-
AuthorPosts
-
-
March 6, 2014 at 6:51 pm #1514
ralmestroMemberBefore, I reported two bugs about file upload and forgot talk about the great job creating Piklist, thanks for the opportunity to use it.
One question
Exist any option to add a google map location as a custom field?Thanks
-
March 6, 2014 at 10:41 pm #1521
SteveKeymaster@ralmestro– We currently do not have a Google maps option or plugin.
-
August 1, 2014 at 5:01 pm #2124
bicho44MemberAny news about to add this type of field?
Thanks in advance
Fede
-
August 2, 2014 at 9:36 am #2125
KevinKeymasterWhat are the core features for such a field and how should they work. This would be a great place to get that discussion rolling. What kinds of things do you feel are necessary for such a field?
On a related note, in the coming weeks we will start to show people how to create their own fields easily with Piklist so stay tuned!
Thanks,
Kevin
-
August 4, 2014 at 7:14 pm #2139
bicho44MemberFirst sorry, because im so late 😀 with my answer.
The idea is this, when you add a Google Map field you obtain to spaces (fields) the first one is the address and the second one is the map itself, where yo see (realtime) the change you made in the address field and also the pointer.

Then you have a
magic wayfunction to put that map in the front end avoiding all the google nonsense 😀I hope this help
Thanks in advance.
-
May 13, 2015 at 8:52 am #3687
bicho44MemberHi, everybody, any news about the google map field?
Thanks in advance
-
May 13, 2015 at 10:31 am #3688
ndbeMemberThis is a simple solution to put google maps in your admin panel. User can drag the marker and the position will be saved in latLang custom field:
piklist('field',array( 'type'=>'html', 'label' => 'Map', 'value' => '<div id="project_map" style="height:500px;"></div>', )); piklist('field',array( 'type'=>'hidden', 'field'=>'latLang' )); ?> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> var map; var marker var latLangField = jQuery('#_post_meta_latLang_0'); var zoom = 15; var latLang = latLangField.val(); if(latLang == '') { latLang = "54.470636, 18.469391"; zoom = 8; } latLang = latLang.split(','); function initialize() { var mapOptions = { zoom:zoom, center: new google.maps.LatLng(latLang[0],latLang[1]) } map = new google.maps.Map(document.getElementById('project_map'),mapOptions); marker = new google.maps.Marker({ draggable: true, position: new google.maps.LatLng(latLang[0],latLang[1]), map: map, title: "Your location" }); google.maps.event.addListener(marker, 'dragend', function (event) { var lat = this.getPosition().lat(); var lang = this.getPosition().lng(); latLangField.val(lat+','+lang); }); } google.maps.event.addDomListener(window, 'load', initialize); </script> <?phpYou will have to change ‘#_post_meta_latLang_0’ to the ID of your hidden field.
-
February 7, 2016 at 12:24 pm #5872
helmiaditya14MemberThanks, ndbe! Tested your code and it works flawlessly on the backend.
However, I was trying to replicate the same thing on the front-end, but the page returned blank after submit and no data was saved. Any idea how to resolve this?
Thank you!
-
-
May 13, 2015 at 2:37 pm #3689
bicho44MemberWOW, thanks, i gonna try it later
-
-
AuthorPosts
- The topic ‘Google Map’ is closed to new replies.