Closed (fixed)
Project:
Geofield
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Dec 2011 at 09:35 UTC
Updated:
21 Jan 2012 at 04:40 UTC
On various places is a text displayed that some users don't want. Specialy for productivity sites.
The module prints a "Test" out. Please remove this on releases.
Comments
Comment #1
tecjam commentedThis is found on line 93 of the geofield_map.module file.
$element[0]['#markup'] = '<div style="width: ' . $width . '; height: ' . $height . '" id="geofield_map_entity_' . $entity_id . '" class="geofieldMap">Test</div>';Line 147 of includes/geofield_map_plugin_style_map.inc
return '<div style="width: ' . $width . '; height: ' . $height . '" id="geofield_map_' . $this->view->name . '_' . $this->view->current_display . '" class="geofieldMap">Test</div>';and last but not least, in the javascript file:
Line 79 of js/geofield_maps.js
I would much prefer the node title to display there on hover. And also be able to use google.maps.InfoWindow class to open a window on click with maybe node title, image address and any other field you wish to show in it.
Now .. how to do it?
Ok, so after some taking apart we first need to define the node title, so we need to edit the geofield_map_field_formatter_view () function in geofield_map.module
so I added the following after line 51 - which reads:
$element = array();Then we need to define it in js, so in line 77 i modified this:
and added the node title:
$js_settings = array(
$entity_id => array(
'map_id' => 'geofield_map_entity_' . $entity_id,
'map_settings' => $map_settings,
'data' => geofield_map_process_points($raw_data),
// add node title
'entity_title' => $entity_title,
),
);
now I presume we need to grab the stuff in the .js file:
around line 13
now replace the "test" text with entity_title i think, but I can't get the last thing to work .. I'll try a little later.
Comment #2
Brandonian commented@tecjam, thanks for hunting down my dummy text. I had forgotten how many places I had left.
I've just commited a change on 7.x-1.x-dev for #1359606: Geofield Map - multiple minor issues that should take care of the alt text in Views. If you grab the latest dev, you now have the ability to define what is displayed there in the style options of the view.
We still need to address the standalone element and marker alt texts. Because this submodule of geofield is meant to be used only for very basic mapping cases, I'd like to keep things simple. I propose we provide a similar alt text option on the standalone entity map display options, and drop the title altogether for the markers.
Comment #3
RuiMendes commentedHi,
I'm using views display a geofield with the formatter "Geofield Map" but what I get as output is:
<div id="geofield_map_entity_field_event_geofield_3" class="geofieldMap" style="width: 100%; height: 300px">Test</div>instead of the actual map.
Could someone please help. One other problem that I've found is that if the formatter "Geofield Map" when I try to edit the field on the view the edition popup doesn't show.
Thanks.
Btw the others formatters works, the problem apparently is only with the "Geofield Map" formatter.
Comment #4
phayes commentedThis has been fixed here: http://drupalcode.org/project/geofield.git/commit/746bd57