I'm using leaflet.js to create a map page displaying events with descriptive map pins based on location. The javascript initialization for each pin looks like the following:

L.marker([41.8781136, -87.62979819999998], {icon: mainIcon}).addTo(map)

I'm then binding a pop-up to each pin with text to describe the relevant event. Thus, I'm wondering if there is an EE add-on that would, ideally, auto-populate fields for latitude and longitude when a user enters a city and state-- such as San Francisco, CA-- from which I can then pull the info with EE channel fields via in the following manner:

L.marker([{lat}, {lon}], {icon: mainIcon}).addTo(map)

This is all the functionality I would need-- is there a simple add-on out there that would make this possible? Thanks for any guidance here.

  • If you use Channel Forms - why just don't do JS request for this and populate hidden lat/long fields? – Max Lazar Dec 6 '14 at 23:32
  • Thanks Max- I'm relatively new to EE and not sure what you mean by Channel Forms, can you elaborate on your answer? I have a set of custom fields configured for an "Events" channel for which users data via the standard "publish" EE form. – nickpish Dec 6 '14 at 23:51
  • so, they add this data inside CP? – Max Lazar Dec 7 '14 at 17:36
  • Given that the number of cities to be chosen is finite, I ended up creating categories for each location with category fields for the latitude and longitude values for each city (I'm loving the categories feature in EE :) – nickpish Dec 8 '14 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.