Hello, I'm trying to run the module with a view of type "content" but does not seem to work. I'm probably missing something.

The view is a list of nodes with a field through the module "geolocation". I enabled the format "Map (Google, via IP Geolocation)" and added the field of geolocation in the form "Static Google Map". My idea is to show a group of fields in the bubble marker by clicking.

In the page style options I added the machine name "field_localizacion" and marked "Center the map on the visitor's current location" and unchecked "Use HTML5 style of visitor location retrieval."

The module works properly if I use the kind of view "IP Geolocations" but I want to try other types of views. I have a test site where you can see the views.

http://10en12.com/demos/maps/locales
(The first block in that page is empty and the second one is a view of type "IP Geolocations" working fine)

Also get this error:
Notice: Undefined variable: visitor_marker in include () (line 30 of / home/10en12/www/demos/maps/sites/all/modules/ip_geoloc/views/ip-geoloc-map.tpl.php).

Any ideas? Thanks in advance.

Comments

rdeboer’s picture

Hi khiustin,

By and large, what you describe should work for a normal "Content" View using the Geolocation Field module.

A couple of comments:
If all you want is the fields you have in your View to appear in the marker balloons when clicked, then you don't have to select "Static Google map" for your geolocation field. Use "Simple Text Based formatter" instead. When you select "Static Google map", then a small map of the area around the marker will be put in each balloon (see also the IP Geolocation project page).

One thing I noticed when I visited your site and turned on the debug in Google Chrome was this message:
"Warning: you have included the Google Maps API multiple times on this page. This may cause unexpected errors. "
Maybe there's an issue with having TWO maps on the same page? I wouldn't think so, but try taking the second map off, maybe the first one will appear?
Or could it be this main.js file that is included TWICE by maps.gstatic.com? What is that?

Rik

PS: does this error re "visitor_marker" still happen with the latest dev version? I can't seem to reproduce it.

khiustin’s picture

Thanks for the quick reply, now it works fine with just one map and changing to "Simple Text Based formatter".

Just one more question.

I need the user to restrict the number of nodes that are displayed to a certain geographic region. The content type I use has a taxonomy reference field, so I use it as exposed filter in the view, but it seems not work fine. (Demo: http://10en12.com/demos/maps/locales). Regardless the region the user selects, nodes are always displayed in the region where it is at that time and the others not always displayed.

So in summary I need:
1 - A views showing nodes in the region in which the user is, or all of them with the user position marker (just for the user reference).
2 - The user can select from a list of regions (with a exposed filter in the view?) and reduce the number of nodes to the selected region.

Is that possible with this module and a "content" view?
Thanks again for your help.

rdeboer’s picture

Hi Khiustin,

I think I know what you mean. When I went to your demo site, it centered the map on Melbourne, Australia (as that's where I am), which of course shows none of the markers in Spain.

First, in your View temporarily switch to Table format to convince yourself that the output of the View is correct. Because what you see in the table will be what goes on to the map for each value of the region filter.

Then switch back to Map (Google, via IP Geolocation) and have a closer look at the settings (you need to retype the location field names...). Maybe under Map centering options you should pick "Use the first location returned by the view as the center of the map". This way you can still have a visitor marker (and in a special colour), but the map won't be centered on it.
Will that solve your issue?

Rik

khiustin’s picture

Hi Rik, thanks for your feedback and happy news.
I made two page displays, one for the table and one for the map. The map display has the field and the centering option as you suggest in your comment. If you want to see both:

http://10en12.com/demos/maps/bookmakers-map >> map
http://10en12.com/demos/maps/locales >> table

At first the view only worked correctly in the table format, but after trying and testing I came off ajax and voila!!! the map now also works correctly with the filters. So there may be an incompatibility issue between the Views ajax / filter and module in this version??. It sounds meaningful to you?

Kt

rdeboer’s picture

Status: Active » Fixed

Hi Kt,
Thanks for the feedback, glad it's all working for you. Site looks good!

I"ll have a closer look the Ajax option and possible interference with IP Geolocation -- thanks fort the tip! Maybe related to #1682348: Display distance with Views PHP and Ajax.

Are you aware that you can prevent fields that are in your view from appearing in the marker balloons by ticking the little Exclude from display box on the UI panels for those fields? That way you can suppress latitude and longitude from the balloons, for instance.
Rik

PS1: the position marker is nice and yellow, but the contents of the balloon appear empty.... did you make the text colour white (on a white background)?
PS2: If you wanted to, you could have the table below the map and use only ONE region selector, see this module Views Global Filter.

khiustin’s picture

Hi Rik, thanks to you!
If you go to the site now looks much better I think so... :-)

Just: http://10en12.com/demos/maps

Now I'm working on styles and I used the hidden display option as you says, so now time for the "white/white" styled things to get better ;-)

I have further questions on how can I change the marker icon that shows Google by default? It is possible from the settings of the view like with the height, zoom, type of map view, etc.? I have two custom icons, one for the nodes and one for the user position...

Kt

rdeboer’s picture

Hi Kt,
No, other than the colour of the visitor location marker, you cannot set marker colours or shapes yet on the standard Google maps. I will be looking into this.

However you can select maker colours and shapes when you install the OpenLayers module, which gives you a whole swag of map styles, including Bing, Google, OSM etc.
When enabled, in the View UI, under Format you'll get a new option Map (OpenLayers, via IP Geolocation). Simply click that and you're away.
Until 7.x-1.14 comes out I would recommend the 7.x-1.x-dev version of IP Geolocation for use with OpenLayers, especially if you want the balloon texts to work.
OpenLayers has many options. To help you navigate through it, I've lifted the text below from the IP Geolocation README file.

A FEW OPENLAYERS TIPS WHEN CREATING MAPS OF VIEWS
==================================
Of the modules in OpenLayers package you only need to enable OpenLayers and
OpenLayers UI. In fact, you could even disable OpenLayers UI when you're done
configuring your views.
Initially the location markers are likely to show up as black circles. To
change the marker shapes and colours you need to first associate the "Location
markers" layer with your map at Structure >> OpenLayers >> Maps >> List. If
there is no custom map on this page yet, you have to first clone and save under
a different name, one of the existing maps. Once you've done that, you'll find
that on Structure >> OpenLayers >> Maps >> List the map appears with an Edit
link. Click that, followed by the "Layers & Styles" vertical tab. In the bottom
section of the page you'll find the "Location markers" and "Current visitor
marker" layers with check boxes to activate them and to select their marker
styles. Pick from the drop-downs as you please. Then press Save. Note that the
location markers won't show up in the map preview, but the visitor marker
should. This is because the map doesn't know which view it will be paired with.
In fact there may be several views using the same map. Return to edit your view.
Under Format, Settings select the map you've just created and edited. Save the
format and the view. Visit the page containing your view and all markers should
appear in the colours you chose.
In order to make the text balloons pop up at a marker when hovered or clicked,
visit Structure >> OpenLayers >> Maps >> Edit and click the "Behaviors"
vertical tab. Scroll down the page until you reach the "Pop Up for Features"
check box. Tick it and select the layers you're interested with, e.g.
ip_geoloc_visitor_marker_layer and/or ip_geoloc_marker_layer. Same for "Tooltip
for Features". Other nice behaviors that you may wish to flick on on the same
page are "Full Screen", "Layer Switcher", "Pan and Zoom Bar Controls" and
"Scale Line".

rdeboer’s picture

Further to #7....

The latest dev (snapshot available Wed 18-July, 12:30pm) features marker colour selection for location markers:
blue, light-blue, grey, green, orange, pink, purple, red, red+dot, red+square, red cluster, white and yellow.

Rik

khiustin’s picture

Hi Rik. Thanks.
Finally I have the work with the map almost done with two combination of modules:

- IP Geolocation Views and Maps
- Location
- Openlayers
With this group I can set two different markers and earn more granularity in views exposed filters. The bad news comes with the balloon in the openlayer map, because the balloon does not show all fields from the node (Just the title, and address data from location module)

- IP Geolocation Views and Maps
- Geolocation Field
- Openlayers
With this set up where I saw I can only show one type of marker and I have less granularity in views filters, but I can put custom fields.

So I'm in the process of "what the client really wants" to decide the final winner.

rdeboer’s picture

Hi Kt,
Regarding balloon text... if you use 7.x-1.x-dev and select Map (OpenLayers, via IP Geolocation) for the View format, then surely all fields from the view go into the OpenLayers balloon?
Rik

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.