ugghh!! this is a frustrating module to set up.

Been struggling trying to get a simple Google Map added to a node page. I had a std openlayers map; no gmap and then upgraded to latest -dev to get support for gmap api 3.

now that i have done that i had been able (but lost it) to get a gmap; but with an error msg on every node page with a map and numerous copies of the msg on the maps/edit map page

msg is

OpenLayers layers failed the sanity check

and various errors in the log include:

Layer eventmap not found.
Layer is unavailable because its layer type or the module that provides its layer type is missing
Layer does not have a projection set.
and others

i am guessing numerous bugs in latest dev; but possibly proper config could clean some of this up.

Is gmap supported yet? any guide to setting this up?

Comments

liquidcms’s picture

Title: any recipe to get a simple G-Map on a node » OpenLayers layers failed the sanity check

better title

liquidcms’s picture

- flushed cache
- deleted map definition
- started everything from scratch

- seem to have gotten rid of errors and i now have a gmap but it doesnt zoom to my location (although does show it if i zoom out far enough)

still wondering if anyone has gotten this working.

liquidcms’s picture

Title: OpenLayers layers failed the sanity check » GMap not working.
Component: Documentation » Code
Category: support » bug
Priority: Normal » Major

giving up and changing this to a bug:

- won't show location on map (although it did earlier)
- has silly Map Info popup that shows when page loads and every time i touch the map
- doesn't center to location (although doesn't even show it so i guess this makes sense)

i think caching issues here as well - it doesnt appear to be good enough to make mods to OL config (map) you need to go through and resubmit field display to get it to use this.

liquidcms’s picture

btw.. Geofield Formatter Map display formatter does seem to work correctly; just gmap custom formatters do not.

nod_’s picture

Well, I got no problems getting it to work. Could you provide an export of you map ?

I get the info popup sometimes too. Try desactivating the attribution behavior, could be that.

liquidcms’s picture

pretty frustrating there are certainly bugs here... doesn't seem to matter now what i pick for behaviors; it has no affect on the map.

export is:

$items = array();
$openlayers_maps = new stdClass;
$openlayers_maps->disabled = FALSE; /* Edit this to true to make a default openlayers_maps disabled initially */
$openlayers_maps->api_version = 1;
$openlayers_maps->name = 'event_map';
$openlayers_maps->title = 'Event Map';
$openlayers_maps->description = 'Map for events';
$openlayers_maps->data = array(
  'width' => 'auto',
  'height' => '400px',
  'image_path' => '',
  'css_path' => '',
  'proxy_host' => '',
  'hide_empty_map' => 0,
  'center' => array(
    'initial' => array(
      'centerpoint' => '-98.437499996007, 39.334297428484',
      'zoom' => '4',
    ),
    'restrict' => array(
      'restrictextent' => 0,
      'restrictedExtent' => '',
    ),
  ),
  'behaviors' => array(
    'openlayers_behavior_geofield' => array(),
    'openlayers_behavior_dragpan' => array(),
    'openlayers_behavior_panzoombar' => array(),
    'openlayers_behavior_panzoom' => array(),
  ),
  'default_layer' => 'google_normal',
  'layers' => array(
    'google_normal' => 'google_normal',
    'osm_mapnik' => 'osm_mapnik',
    'geofield_formatter' => 'geofield_formatter',
    'event_location_openlayers_1' => 'event_location_openlayers_1',
  ),
  'layer_weight' => array(
    'geofield_formatter' => '0',
    'event_location_openlayers_1' => '0',
  ),
  'layer_styles' => array(
    'event_location_openlayers_1' => 'Event Style',
    'geofield_formatter' => 'Event Style',
  ),
  'layer_styles_select' => array(
    'event_location_openlayers_1' => 'Event Style',
    'geofield_formatter' => 'Event Style',
  ),
  'layer_activated' => array(
    'event_location_openlayers_1' => 'event_location_openlayers_1',
    'geofield_formatter' => 'geofield_formatter',
  ),
  'layer_switcher' => array(
    'event_location_openlayers_1' => 'event_location_openlayers_1',
    'geofield_formatter' => 'geofield_formatter',
  ),
  'projection' => '900913',
  'displayProjection' => '4326',
  'styles' => array(
    'default' => 'Event Style',
    'select' => 'Event Style',
    'temporary' => 'Event Style',
  ),
  'map_name' => 'event_map',
);
$items["event_map"] = $openlayers_maps;
return $items;

location is Miami, map looks like this: http://screencast.com/t/gugf979L

nod_’s picture

umm you have too much behaviors on this. panzoombar and panzoom are not supposed to be together. But the problem is the geofield behavior. It's a map for display i suppose ? So you don't need the drawing features. map input and map display should be handled by two different maps.

But really there is a geofield issue in there too, i'll check that out.

nod_’s picture

see #1343610: Draw feature doesn't respect behavior settings there is a patch that fixes that. But really you shouldn't use geofield behavior on map used for display.

liquidcms’s picture

patch doesn't apply so will need to go through and do it manually. with all the behaviors removed though; still has no impact on the map.

i'll likely need to do what i did last time - delete the map and add a new one.

also, how would i know what behaviors won't go together ?

liquidcms’s picture

yes, deleting and re-adding showed things change: http://screencast.com/t/IumPllZD

now i get marker showing for the city

- still has popup
- not centered to city
- zoom level is wrong

i'll play a bit more, and eventually get that patch in, but having to delete to edit is an issue.

nod_’s picture

The patch is for the dev version of geofield module, not openlayers.

For centering, you probably need the zoom to layer behavior too.

Well you can enable all the behaviors at once, but you'll have a few positioning issues. For example if you have panzoom and panzoombar at the same time you'll have 2 controls overlaping on the left side. Same thing if you enable drawing and fullscreen behavior. Usually it's not too much of an issue.

nod_’s picture

Category: bug » support
liquidcms’s picture

not sure how this isn't a bug? the only way i can change settings is to delete map config and start over.

nod_’s picture

Sure sounds like a bug. But that's unrelated to gmap not working because of behaviors and all.

Open another issue with more details if you feels it's a bug.

nod_’s picture

BTW you ran update.php after upgrading to dev ? i don't remember if there is suff to upgrade but you never know.

liquidcms’s picture

Priority: Normal » Major

ok, so it seems i didnt have latest -dev; now i do and patch applies correctly.. :)

getting a bit closer:

- i can now make changes to behaviors without starting a new map each time (which certainly speeds up the trial/error approach to figuring this out.. :( )
- figured out i needed to pick the locator for my event field in "zoom to layer"

with just these 2 behaviors enabled: http://screencast.com/t/K4xRB4wl

i get this: http://screencast.com/t/V8blrEo01

issues:
- miami is shown on map; but not centered there
- there is some other dot added in the middle of the US for some reason
- can't get rid of map data popup - maybe simply hiding this in css would work

is getting a little closer though.. thanks for your help so far.

nod_’s picture

great :)

if there is a point somewhere there is data where it came from. This is a view layer right ? did you check you have the right filters/settings to select only the one you want ?

map data popup i belive that could be a bug, try again tomorrow, if it's still there it could be a bug, if it's not there it's gmap putting some limits or something.

zzolo’s picture

Priority: Major » Normal

For the large GMap attribution message, the fix is to update the library you are using to OpenLayers 2.11.

You should download it for better for performance and reliability, or you can use this URL: http://openlayers.org/api/2.11/OpenLayers.js

liquidcms’s picture

Priority: Major » Normal

@17 - what view?? lol.. there is no view involved here; this is simply a node display

liquidcms’s picture

ok, well not the answer but your comment about Views made me go look. i guess for behaviors i get this:

http://screencast.com/t/41ZSGjeZY

- google map doesnt work at all
- the event map one is from a view (but certainly cant imagine i need views to make this work)
- the geofield one, no idea where it comes from or what it is for; but it seems to work: http://screencast.com/t/XhtAqLBz

just need to get rid of popup and we're all good. will try upgrading lib as stated above

thanks for your help, much appreciated.. but wow.. and i guess this is the D7 way.. but ridiculously complex for something so simple. could have done this in 2 min with a couple clicks in D6.. i guess the advantage is a lot more features here now?? i guess perhaps Features is going to be a major requirement and possibly make it in to core as need some sort of pre-canned settings for things like "basic gmap" or maybe just some documentation.. :)

nod_’s picture

don't know just assumed that was the case 'event_location_openlayers_1' looks like a genarated name, not something you'd write up intentionally. Sue me :þ

It doesn't change the fact that if you have a point displaying somewhere there is data to make it show up. Get rid of it and you'll have you map centered on miami. Or disable the zoom to layer behavior and force the init center and zoom level in the map config.

liquidcms’s picture

Category: support » bug

only thing left is that the mystery dot is still there if i zoom out far enough: http://screencast.com/t/kUVMMbbmP

again, no data on this node, no view involved in this

nod_’s picture

have something online we can take a look at ? would be quicker. OL doesn't make up data.

nod_’s picture

Umm, enable the layer switcher behavior. And play around with that. 1 cookie the other point comes from the views layer.
But really it looks like you could use some doc reading too.

liquidcms’s picture

i have this now: http://screencast.com/t/7Kg97sm6Yclm

the 3 points are indeed the 3 Event nodes i have in system at the moment. the one that isn't tied to a city is because 1 event has no location data entered.

if you tell me this module only works with a view to provide the date; as opposed to using the location field that is on the node i am viewing; then that is fine (silly, but fine) - i can create a view with an arg of current nid

but sort of seems like a bug for it to pick up ALL the location content from the entire site for no apparent reason.

demo node is here: http://oow.liquidcms.org/event/iitsec-2011 admin login is admin/admin

nod_’s picture

Category: bug » support

Config issue. I never said you needed a view to display your point.

I went to your map config, disable the "event_location: - OpenLayers Data Overlay" layer (just unchecked all the checkboxes) and check the "activated" checkbox of the geofield layer. The extra point was indeed the views layer.

Next time, read the documentation please and post in the right issue queue, that was all a geofield problem. For this kind of things, geofield has a small module which you can use to display simple geometry. Try that. You'll still need the openlayers module to be able to input with a map. there is work underway to make it possible without openalyers #1273802: Geofield/Openlayers widget refactor

Now if you'll excuse me, i'll go get myself a cookie.

nod_’s picture

Status: Active » Fixed
liquidcms’s picture

thanks for all your help. read what i could find but perhaps should have looked harder. hard to tell what is geofield and what is openlayers.. all of this is under openlayers config (i think)

likely just frustrated this isn't anywhere near as easy as it was in D6... but seems to be the d7 way.. :(

cookie is on me.. :)

nod_’s picture

You can always open another issue to improve UX with some pointer about how to do it better, I don't really like how it is either but i'm too much into it right now to have any kind of constructive comment about that.

Status: Fixed » Closed (fixed)

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

algazaras’s picture

Hi there,
@liquidCMS
I have run in the same popup problem, and I wonder if you were able to fix it. It displays in every node and I don't even have the option to close it (that I can only do in the preview of the OpenLayers section).
I hope you can help me