Posted by orkutmuratyilmaz on December 12, 2012 at 5:12pm
Hello Spatial Drupalists,
I'm trying to geocode city names and show it on leaflet map, at the node add/edit forms. Is there a way to do it?
Thanks for your kind help:))
Hello Spatial Drupalists,
I'm trying to geocode city names and show it on leaflet map, at the node add/edit forms. Is there a way to do it?
Thanks for your kind help:))
Comments
Do you instantly want to show
Do you instantly want to show the map in the edit form when the user enters a city? Or show the point on a Leaflet map after the node saved?
If first, then I dont know a solution with Leaflef but I did it with Geolocation module. It has a nice widget where you can enter a city name, and it points the city in the map right away. Unfortunately the stored result is only stored as lat,lon pairs. I didn't find a way to save actual text input by the user. Maybe it can be done with some JS to store the text in that field onto another text field on the fly.
If you want the second one, you can use an address field in the edit form to collect the city information. Then you can use Geocoder to convert this field into Geofield. You can later use this Geofield with Leaflet.
We need first option to build
Actually we thought about second option yesterday as Plan B, so as Turks said "The path of inteligence is one":))
We're going to try your suggestion for first scenario. Thanks for your kind help&cooperation:)
http://geoperformans.com
First option tested with success
It works!
We installed Geolocation module with Google Maps submodule enabled. Editor can insert a placemark by either entering text or mouse click.
http://randomind.com
A better solution could be ...
We realized that we were losing geofield functionality and decided to use an input widget for geofield. So Geolocation Google Maps module was dropped in favor of Geofield Gmap module. This new one provides an autocomplete geocoder with geofield support. We used Leaflet Views module for displaying markers.
http://randomind.com