embed google maps with search and locator functionality in drupal 7..? - drupal

I Want to to create a page in my drupal 7 site with a google map on it, which shows hospitals, clinics and pharmacies near the user.
I tried, location module and openLayerslocator. But I couldn't figure how to achieve it using these modules. Initially I came to know that, I can use to openLayers locator, but there is no documentation or guide that's available to achieve it.
But as far as I understand, both modules work in a similar way but NOT as I want it to. In both module, I will have a content type called 'Location' and it will as for address,zip code etc while creating the content with that type. Then there will be a view, which takes these address from those 'Location' noddes and displays those addresses on a google map..! But THAT'S NOT WHAT I WANT.
I do not want user to create any content or anything, the map sits there as a page where user visits it, to see what are the hospitals etc are there around him. When user navigates to that page, he will just enter his city, address or zipcode (like in a form and hits find) to see what are the hospitals around him (let's say around a distance of 50km). By default, when he navigates to the page, the map should be showing those places like hospitals and clinics around his default address (It will be available from the database.).
So how can I achieve it...??
Thanks in advance.

Related

How do Google Analytics advanced segment filters work?

I'm trying to filter people who landed on a specific page and who were also new users (i.e., they landed on my site for the first time through this entry page).
That way I can track loyalty behavior of users who found my site via a specific landing page.
But I'm confused about the difference between using 'AND' in the same filter or creating a brand new filter in the GA's advanced filters.
I can't understand the difference between the two, but they do show slightly different data. Also, the loyalty is much better in the second version (with filters).
Which is the correct way to get the right data?
including and is a way to drill down into the exact thing you are looking for. It seems you were on the right track; I would put
Landing Page > Contains > URI
AND
User Type > Exactly Matches > New Visitor
If you use them together (I.E) URI of specific Landing page AND New Visitors, you will drill down to only new users who viewed your landing page.
If you create two separate Advanced segments, you will only get comparisons of new users who viewed your website to users who viewed your landing page.
What you could also do is create a new view(If you have Admin Access) and create a filter that only shows new visitors who came to your website via a specific landing page only.
I would say creating the filter in a new view is easier than the Advanced Segment.

How to show pages visited during sessions marked with a custom variable in Google Analytics?

I embed custom links into each resume I send out, so I can see who as clicked on the links. I then take the custom value (passed through a url parameter) and pass it into Google Analytics as a session level custom variable. What I want to do is create a report that will show me all the typical information I can normally see (pages visited, time, etc), but filtered down by custom variables. i.e. I want to see that people form company X have looked at these parts of my website. I've been reading through all the documentation and feel like a custom report is the right way to go, but I'm not really sure. Any suggestions, links, instructions would be appreciated.
Create a custom report. Play around with some configuration like the following:

search form on different page for Google Maps

Is it possible to have a search form on every page of my WordPress site, in the header.php for instance, that contains a search form for Google Maps? When someone adds their postcode into the box they get redirected to the search results page which shows their results.
If so, does anyone know how this works or can anyone provide any code?
Many thanks
M
This is quite possible, and is described here in google's API. You can redirect the user using data gathered by your form, or you can actually even embed a map into your own webpage (which seems like a better user experience, and lets the user spend more time on your site).

Drupal only display certain content based on location

I need to be able to only display certain content/nodes based on where a user is located in the world. For example, if the user is from the US, they should see different results than someone from Europe.
Ideally I would be able to tag each node with the region(s) that it should be displayed in and then when the content is displayed, it is filtered by these tags.
I'm also going to be using various content 'scrollers' to display content and I would like these to have different content based on location as well.
How would I best achieve this?
Use Views - and cool modules like:
Use modules like smart_ip http://drupal.org/project/smart_ip & Ip Geolocation http://drupal.org/project/ip_geoloc
Read the info on those module pages they will help you get on the right track
Basically you want to first get the location of the user, this will be stored in the session.
once you have that you can reference it any time.
I know this is an old thread, but it's one that doesn't necessarily have an easy solution in Drupal. Here's how I did it. This solution doesn't match the original question exactly, but this explains a method that could be extended to cover that scenario by extending the PHP code to compare the user's location to the taxonomy term(s) assigned to each node.
First, install IP2Country. This allows you to match an IP address to someone's country by doing a geolocation lookup.
Second, use PHP code like this to determine if the visitor's IP address matches a certain country. This example returns true if the visitor is in the US or Canada, and false if they are not.
<?php
$detectedcountry = module_invoke('ip2country','get_country',$_SERVER['REMOTE_ADDR']);
$countries = array(
'US','CA'
);
if(in_array($detectedcountry,$countries)){
return true;
}
else return false;
?>
You can use this code in various places, but you will need to enable the PHP filter module for it to work.
In my solution, I used this code in two ways:
First, I created a Panels Variant for a Node Template (could be a Taxonomy Term template as well) to return a HTTP response rather than a Panel Pane. I used this code as a selection rule, so it would return a 404 if the user was not in a country that was allowed to see that specific node type. I then created Panels variant that returned the node page for anyone who qualified based on their location.
Second, I created a Panels variant for a node type (Product, in this case) and used the same PHP code to hide certain elements on the page for those users who weren't allowed to see them because of their location. In this case, I hid the Price and Add to Cart panes on a product display page. Visitors outside the allowed countries only saw the product information, and not the ecommerce elements on the page.
As a third option, you could also use it to show/hide Drupal blocks using the same code.
Finally, I created a custom theme function so I could show/hide individual menu items depending on a person's location. In this case, I wanted to hide the Shop menu item unless you were in the permitted countries. I wrote about how to do that in more detail here: https://fiveminutelessons.com/learn-drupal-sitebuilding/show-or-hide-menu-item-drupal-7-based-users-location

How can I pull images from Flickr into Drupal website based on specified tags?

I work for a registered children's charity and social enterprise, and we've recently relaunched our website - built on Drupal, which is great.
To help bring to life what we do, we serve a random selection of images across the site - simply pulling them from one of our own generic 'best of' sets on Flickr - but desperately need to filter these for different sections of the site, so they are more relevant. The most obvious, flexible and efficient option would be to call images from Flickr based on tags, only the main Flickr module doesn't appear to allow for this.
Having spoken with our IT guy, we came up with the below (which is pretty exhaustive, so happy to be flexible for speedy solution).
Hope someone on here can help - and at a reasonable rate..!
Essentially we need a field type similar to that used by the existing flickr module photo set; one that can be attached to any content type but allows the input of one or more flickr tags (as opposed to just single photo or set as is currently the case). As with the existing flickr photo set, we also need a content pane/block to present a random flickr photo based on the tag(s) specified.
Ideally, on the content creation/edit form, the user would be presented with a list of qualified tags pulled from the flickr account. Failing that, tags entered should be validated as having one or more flickr photos from the specified account on form submission.
As is the case with the standard module, when images are clicked on, a new page should open on the main flickr site showing this image (with the usual related set/tag based images).
Flickr has a very nice API. You should install flickr module from Drupal.org then create a custom module to get and display images from your flickr account.
Flickr module has a function you can use to make your own API calls to flickr: flickr_request(method, params). Here's how you can search photos by tags on flickr: http://www.flickr.com/services/api/flickr.photos.search.html
Hope this can lead you to the right direction :)

Resources