I have OpenLayers and Geofield installed.
My goal is to have 2 pages.
First - node edit, where user can input his location using Geofield with Openlayers Map widget. This works fine.
Second - custom Views using OpenLayers, showing some nodes in map based on some filters(doesn't work).
The problem is in empty map, views shows map but empty. Views for OpenLayers are created and configured step by step using documentation (before this I had successful openlayers configurations). I'm trying to find possible problem for hours.
After issuing this problem i have created simple lat and long float fields and modified views to use that fields. Again, no luck.
OpenLayers Data Overlay renders the following
You can use the following parameters in your styles as dynamic values
------------
${field_lati_rendered}
${field_lati}
${field_longti_rendered}
${field_longti}
------------
The following is a dump of the data that is rendered from this display. It is used for debugging purposes only.
array (
0 =>
array (
'projection' => '4326',
'attributes' =>
array (
'field_lati_rendered' => '41.0000000000',
'field_lati' => '41.0000000000',
'field_longti_rendered' => '42.0000000000',
'field_longti' => '42.0000000000',
),
'wkt' => 'POINT(42.0000000000 41.0000000000)',
),
)
So, this looks OK, it seems that this Display sends correct information.
I have also dumped dprint_r($this->view) in openlayers_views_style_map.inc file's render() function. I tried basic search using browser to find '42.000' coordinate. So I don't found. I'm not familiar with Views API. But I think it should be there.
Any ideas? What can cause problem like this? Anyway to debug?
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | OpenlayersViewOverlayExport.txt | 8.49 KB | cluther |
| #14 | map_location_export.txt | 2.82 KB | cluther |
| #14 | OpenLayersMapExport.txt | 2.73 KB | cluther |
| #12 | basic_map_feature-7.x-1.0-dev.tar_.gz | 4.22 KB | mgifford |
Comments
Comment #1
zzolo commentedHi @Toktik. Are you using filters or arguments with your Views OpenLayers Data Overlay?
--
Please do not mark things as critical unless it is that for everyone. Also, without a specific bug, please default to Support Request.
Comment #2
davycw commentedI'm having a similar problem where I'll create a page view, set up an openlayers map on it, then add the openlayers data overlay display which OVERWRITES my openlayers map page display, essentially trying to render the map itself as the datasource instead of lat/lon or wkt.
So, essentially I'm stuck with either Format: OpenLayers Map on both displays, or Format: OpenLayers Data Overlay on both displays.
Comment #3
Toktik commented@zzolo, I'm using argument.
@swombrother, it seems you are not overriding Format. See Views Override feature.
Comment #4
davycw commentedI'm having trouble finding that feature. Where is it?
Comment #5
zzolo commented@davycw . I think your issue is different and it sounds like you are just not using Views correctly. Try creating a separate View for the Data Overlay, and one for the Map Display.
@Toktik. There could be many reasons why your map isnt showing up.
* Are you sure your argument is working correctly?
* Do you have styles correctly set?
* Can you export your map and paste here?
Comment #6
guillaumev commentedHi,
I'm having the same issue here. I had a map set up properly using features, which was working with geofield alpha5 and openlayers alpha2, upgraded both modules and now everything is gone... It seems like the openlayers data overlay works correctly and that the map finds the right layers, but no point appears on the map...
Comment #7
nod_I've had problems with my points too. Can you check your JS console ? there should be an error, please paste it here.
Comment #8
zzolo commentedIt would also be good if you export your map, and paste the code here as well.
Comment #9
Toktik commentedI have changed a little bit and now I'm using Geolocation Field (doesn't matter, because I get Latitude and Longtitude correctly, I see it in views preview dump). Still can't get point.
here is views export
Comment #10
Admdebian commentedI have the same problem:
http://drupal.org/node/1460988
Comment #11
mgifford@Admdebian - I marked #1460988: Views arguments problem? as a duplicate.
@Toktik - thanks for the views export. Would be useful to have more feature exports for OpenLayers that made it easier for people to set up & get going with this great module.
Comment #12
mgiffordOk, so to try to eliminate possible problems, I've tried the following & provided the following feature to help replicate it.
I set up a very basic node with a Geofield WKT input text. I added a POLYGON at a well known location to a piece of sample content I developed. I set up a OpenLayers Map (or in D6 'Preset') and did some minor customizations on that. Then I set up three block views:
1) a basic unformatted list with a Contextual Filter (or in D6 'Argument') for the node ID
2) a clone of that with the Geofield set so that the Formatter set to OpenLayers and the OpenLayers Preset set to Geofield Formatter Map.
3) a clone of that one which is trying to use OpenLayers and has an OpenLayers Map Overlay along side a block.
1 & 2 clearly indicate that they are tied to the node which is being loaded.
I get a map on both 2 & 3, but only see the polygon on 2
Hopefully this feature makes it easier for someone else to figure out what I'm doing wrong. I can't just lean on the Geofield Formatter map as I can't use the Google Maps, but need to select a different set of images to work with.
Comment #13
nerdcore commentedI have created an OpenLayers Data Overlay in Views which is capable of extracting WKT Geofield data from a node and making it available to an OpenLayers Map which has the Data Overlay enabled and activated. This Data Overlay has a contextual filter of Content:Nid so that I can display a single node's WKT POLYGON on a map accompanying the node.
This works fine and can be demonstrated by typing in a node ID into the "preview with contextual filters" option of the View setup. Previewing in this way on the Data Overlay returns the node title, and Geofield WKT POLYGON as expected.
I am hoping to display the map using a Block, so that it can be added to a specific content type. This produces one startling failure when previewing with contextual filters:
So, why does the block know about the WKT field (as demonstrated in an Unformatted List), but fail to render the WKT data as an OpenLayers Map?
Comment #14
clutherHi. I'm experiencing a similar problem and while I haven't been able to completely resolve my issue I hope that my discoveries may assist others.
To recap: I'm seeking to create a dynamic map using OpenLayers, Drupal 7, Views and a Custom Content Type. So far I've been able to:
In OpenLayers Admin I can view the sample map ('MySample Map" - a clone of the GoogleMap example) under OpenLayers Admin: Maps: Edit Map: Preview where it successfully shows data points from content in the database. However when I create a new separate View of format = OpenLayer with style = "MySample Map" almost nothing shows under Views Preview: no datapoints and no map, only the title. Visiting the resulting Views page exhibits the same.
Another poster ( @Toktik ) was also using "Geolocation Field" instead of GeoField. I discovered that in order to get Geolocation Field to minimally work I needed to add the content type's Geolocation Field twice, the first formatted as Latitude data and the second formatted as Longitude data. Then I selected Views Format: Settings and under OpenLayers Data Overlay: Style Options I configured Map Data Sources for Lat/Lon Pair and Latitude Field and Longitude Field to reference their respective fields. I was never able to get WKT to work. For more info see http://drupal.org/node/1469524.
So while I can see the map under OpenLayers Admin I am still unable to produce a usable View. Any recommendations for debugging/resolving this problem? If it could assist anyone I've attached exports of the Views Overlay, the Map Location View, and the OpenLayers Map definition. Thanks in advance.
Comment #15
DerekL commentedI have the same issue, exclusively tied to using google maps layers.
Comment #16
arosboro commentedI'm experiencing the same issue with no wkt points being displayed on the map when geofield is enabled in behaviors of the map, and data overlay as well as page format types are correct. Using openlayers 2.0-beta1
Comment #17
arosboro commentedThis was because I didn't have my map's OpenLayers Data Overlay enabled and active on the layer settings for my map.
Comment #18
sonictruth commentedWhere are the layer settings?
Comment #19
arosboro commented@sonictruth see admin/structure/openlayers/layers and admin/structure/openlayers/maps
Comment #20
ekes commentedSummarizing. Geofield should work - open new ticket with full information of settings (exported) if it's not. Geolocation field uses lon/lat and doesn't store WKT, so follow instructions from #14.
Closing this ticket as part of issue queue cleanup - Drupalcon Munich openlayers sprint.
Comment #20.0
ekes commentedmore explanation
Comment #21
zwerg commentedIn my case a block map is empty while using contextual filters (nid). Trying to change the output to "Geofield map" works fine.
Does sb know why the OL block map doesn't work? A page view with all elements works fine...
Comment #22
redsemar commentedSorry i have not experience with contribution
and my english is poor
i think that i have the same issue
Can you help me please
i have a view, format geofield map , i have build with openlayer some positions and area on the map , in french the map is displayer with markers and area, and i can have link from this markers and area to content , but when i choose arabic with arabic selector , the map and markers are not displayed i can't found solution for displaying map in arabic .
The translation for other view without geofield is good
help me please
i have drupal 7.41 openlayer 7.x-2.0-beta11 geoPHP 7.x-1.7+7-dev Geofield Map 7.x-2.3 Views translation 7.x-3.x-dev
my e-mail : hadikasahira@yahoo.fr