11

You do not really need to write your own module (unless it does something out of the box) in order to use custom markers. Here is an guide how you can do that (I assume we use gmap module and views module to display google map. Upload you custom markers to Drupal website, f.x. to your theme folder (i.e. /sites/all/themes/yourtheme/images/markers or another ...


10

Just thought I'd point out in the this somewhat long-running thread that, due to an update, Dmytro Pastovenskyi's answer is no longer valid in 7.x-2.11. The "Custom markers path" field is still present in the UI form at /admin/config/services/gmap, however any value entered there is effectively ignored. What I did to get it working: Install the Libraries ...


8

The approach should be map agnostic. You need to break things in two parts: Storing location data Displaying this data on a map 1) Data storage. You'll need three modules here: Address field to store addresses (http://drupal.org/project/addressfield) Geofield to store latitude/longitude (http://drupal.org/project/geofield) Geocoder to geocode addresses ...


8

Perhaps this is useful: How the Drupal.org home page map works This is the actual module: HTML5 user geolocation


7

Converting an IP to a latitude and longitude isn't a good idea since the user could be using a proxy. A better way would be to use HTML5 geolocation, which tries to get a location based on a couple of parameters: IP, wireless connection, cell tower location, GPS ... Try: navigator.geolocation.getCurrentPosition(show_map); function show_map(position) { ...


7

The easiest way to use a view in a block (or anything that uses a build array) is as a render element: $node = \Drupal::routeMatch()->getParameter('node'); $current_nid = $node->id(); $view_arguments = [$current_nid]; $build['news'] = [ '#type' => 'view', '#name' => 'myviewname', '#display_id' => 'block_1', '#arguments' => $...


6

Finally i made it. First you make a content type for the items (in this case sted / place). Then you make or edit the content type where the relevant items is going to be displayed (in this case article). For the articles you add a reference field. The Type of item to reference is content and the content type to reference is your items content type. (I ...


5

A module will only be able to do so much to help you with this because everybody's maps and the precise regions that are highlighted and linked are different! So you probably would still have to create your own image map to implement the functionality. I image what they used is the jQuery Map HiLight module with an image map to create that page. The ...


5

You can embed a different View under "No results behaviour" e.g a View that lists all venues.


4

Another option is the recently released Google Store Locator module on drupal.org. Some cool features: you can customize the map marker pins to be your own custom icon, and you can make the map 'location aware' which allows the user to share their location with the browser, and the map will re-center and zoom based on their location.


4

I have been able to accomplish this task following these steps: Installed modules for search: search_api, search_api_location, search_api_solr search_api_views, search_api_facetapi, Search API location views Installed modules for "geosearch": geofield (to store lat, lon...), addressfield (make it easier for users to enter an address and don't worry about ...


4

There are many ways you can do this. Go to maps.google.com, type in the address, get the link, then click the customize and preview embedded view. A popup should appear. Select the map size you want. Copy the html code and go to structure -> blocks -> add block, paste your code and select full html filter. And add your block to where you want it Download ...


3

Getlocations Module (https://drupal.org/project/getlocations) has been the first to bring the GMAP/Location Module (Google Maps V2 Api based) to Google Maps API 3 version. It has rapidly developed and extended its functionalities and is still actively developed … At the same time I would recommend the IP Geolocation Views & Maps (https://drupal.org/...


3

There is a Contrib module for this: the Geolocation module. Just download it, and install it. It actually it comes with 3 sub-modules you need to enable too. Then, when you add a new field to to a content type, you will get a new option for a geolocation field. In case you want to view the locations of all the contents of that content type on a single map, ...


3

Both the Open Layers project and the Gmap module support google maps. Both can work with a number of geolocation types. See the modules for more details. I am using both (in different sites) and either one can support what you are trying to accomplish. I would recommend Open Layers as more versatile, and Gmap as easier to use.


3

If your code sample is accurate, and you are calling drupal_add_js() from outside a function in a module file, then that will be the problem. You would want to add your js from within your hook_block_view(). This way it loads after drupal has done all it needs to do with its js and jQuery will exist. Also, you might not want to put your map initialisation ...


3

The API geocoder may be different from the Maps geocoder (see the FAQ in the API documentation). The results may even vary for users from different users from different countries. For me, Spier Wine Farm, Stellenbosch results on Google Maps in -33.9733628,18.7825561. In general, it seems that sometimes providing less information in an address results in ...


3

Eventually things got fixed, learned that you can just add a .js file into your module with the HOOK_init() since they get stored to use at a later stage. What obviously was causing the problem, was the wrong declaration of the API key, this was fixed by adding the line: drupal_add_js("https://maps.googleapis.com/maps/api/js?key=[MY API KEY]", "external"); ...


3

Usually you see this message when you don't have in the Geolocation module the Google API Key or the Google API Key is not working well. For this you need to go to: http://YOURSITE/admin/config/content/geofield_gmap Write your working Google API Key and save the Configuration. Edit: To apply the patch you need download the file to: sites/all/modules/...


2

For the benefit of others who stumble on this question in future - If you are using a Drupal 7 site, then you can use Location and Gmap modules for this. To allow picking of coordinates from a map you would have to edit the location module settings at admin/config/content/location and CHECK the option for using a google map as shown below


2

Have you checked out the Geolocation Field Module? It works with the Google Maps Api v3 and does exactly what you are trying to do. You add the map as a field/widget within your content-type. The Field stores lat/lon values.


2

The google maps parameters can be changed in file: "sites/all/modules/gmap/js/gmap.js" Here is the option I choose: Street View enabled: opts.streetViewControl = true; Satellite map disabled: opts.mapTypeControl = false; Zoom widget change: opts.zoomControl = true; opts.zoomControlOptions = {}; opts.zoomControlOptions.style = google.maps....


2

Use simple google maps module. It is very simple and easy to use.


2

I was able to find my own answer. This line doesn't necessarily add the attribute to the body tag, but it does call up the map. drupal_add_js('jQuery(document).ready(function () { initialize(); });','inline');


2

Does it have to be a search box? If not, use GMAP's Views integration and create exposed filters for the fields you want to filter by. Instead of a search box, use a dropdown for bedrooms, city, and whatever other filterable fields you include. Using a text input/search box may cause usability issues. You can't account for the variety of keywords a user ...


2

The best way is to use webforms to create your contact form. Make sure to use the option of creating the webform in a block. Create two more blocks. One containing the address and contact and the other containing your map. And using like panels or a page. arrange your blocks on that page.


2

I think you are looking for geofield gmap module, it have the option same like your requirement. See the below screenshot and also easy to configure. Geofield Gmap allow to use a google map v3 map to input a location. A quick text input + geocode allow you to specify an address. You can also drag and drop the marker to narrow the position. Geofield Gmap ...


2

Using the following in my template.php file for my theme, I achieved what I wanted to do. function MY_THEME_preprocess_page(&$vars) { if (isset($vars['node']) && $vars['node']->type == 'venue') { drupal_add_js(drupal_get_path('theme', 'MY_THEME') . '/js/mapstyle.js', array('weight' => 15)); } } I couldn't add the JS to my ....


Only top voted, non community-wiki answers of a minimum length are eligible