[SAC] [OSGeo] #2083: map content integration not working on osgeo.org

#2083: map content integration not working on osgeo.org
---------------------+-------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Keywords:
---------------------+-------------------------------------
I am not quite sure how integration was done between open layers and word-
press for the maps on osgeo.org but it is broken:

1. https://www.osgeo.org/initiatives/geo-for-all/ - should list labs from
https://www.osgeo.org/geo-for-all-labs/

2. https://www.osgeo.org/community/members/ use the filter dropdown to
toggle on the map, should list members visually.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by jive):

For some background read https://github.com/OSGeo/osgeo/issues/123

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:1&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by jive):

Reached out to open layers team:

>I tried to debug the map, but it's impossible to gain any insight from
> the minified code. I did see that the geometries are created
> correctly, but there are some strange variable assignments for the
> cluster source which I cannot make sense of in the minified code.

Reaching out to Get Interactive to try and find original non-minified map.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:2&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------
Changes (by jive):

* Attachment "openstreetmpa.php" added.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by robe):

Jody,

is the attached the patch and is that the name of the file, looks like map
is spelled wrong.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:3&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by jive):

That is fine I cut and pasted it it out of the git repo to share it here
(since the repo is private and open layers team was unable to see it).

Here is a summary of email exchange:

----

Jody:

Found it - https://git.osgeo.org/gitea/osgeo/wordpress/src/branch/master
/wp-content/themes/roots/templates/openstreetmap.php

----

Andreas:

That source code did not help, but I found the issue. It's a data
problem. There is a lab without a location:

labTitle: "Comunidad gvSIG Uruguay"
locationTitle: "Montevideo"
pageUrl: "https://www.osgeo.org/geo-for-all-labs/comunidad-gvsig-uruguay/&quot;

lat and lng are null, but any item added to the map as feature
requires either a geometry with valid coordinates, or no geometry at
all.

The problem is in the updateMarkers function. It should start with

             var markers = ;

             for (var i = 0; i < items.length; i++) {
                 var currentItem = items[i];

                 if (currentItem.locations) {
                     for (var j = 0; j < currentItem.locations.length; j++)
{
                         var lat =
parseFloat(currentItem.locations[j].lat);
                         var lng =
parseFloat(currentItem.locations[j].lng);
                         if (isNaN(lat) || isNaN(lng) { continue }

The last line is the one that needs to be added.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:4&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by jive):

What is the process for applying the above patch to the repo?

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:5&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by robe):

It's just manual at moment. I can apply it for now and then create a new
branch with latest

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:6&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: new
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by robe):

Okay I fixed, the above snippet wasn't complete, was missing a close ) and
had to add the same logic to the currentItem.location section.

https://www.osgeo.org/initiatives/geo-for-all/

I committed changes to this branch
https://git.osgeo.org/gitea/osgeo/wordpress/src/branch/openlayers-fix-
broken-location and deployed.

The diff with the master looks like this.

{{{
@@ -126,6 +126,7 @@

                      for (var j = 0; j < currentItem.locations.length;
j++) {

                          var lat =
parseFloat(currentItem.locations[j].lat);

                          var lng =
parseFloat(currentItem.locations[j].lng);

+ if (isNaN(lat) || isNaN(lng) ) { continue
}

                          markers.push(new ol.Feature({

                              type: 'icon',

@@ -138,7 +139,7 @@

                  } else if (currentItem.location) {

                      var lat = parseFloat(currentItem.location.lat);

                      var lng = parseFloat(currentItem.location.lng);

-

+ if (isNaN(lat) || isNaN(lng) ) { continue }

                      markers.push(new ol.Feature({

                          type: 'icon',

                          geometry: new
ol.geom.Point(convertGoogleMapCordsToOpenLayerCords(lat, lng)),
}}}

I'm going to tag master later as first release we had and then create
another branch that reflects current code. Plugins have been updated etc,
so what is master is not quite what we are running with.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:7&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: closed
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution: fixed
Keywords: |
---------------------+--------------------------------------
Changes (by robe):

* status: new => closed
* resolution: => fixed

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:8&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: reopened
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------
Changes (by jive):

* status: closed => reopened
* resolution: fixed =>

Comment:

Not all maps are working yet, see original description at the top of the
page.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:9&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: reopened
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by robe):

Jody,

Looking at the openstreetmap.php file, I don't think that controls the
members map. I'm not sure what does. The openstreetmap.php only seems to
reference geoforall.

I thought originally it was lack of long / lats missing, but I see it
working on osgeo.getinteractive.nl

and it also seems to work on
https://staging2.www.osgeo.org/community/members/ (well I see a map
anyway with points).

I'll reload the staging2 data from production tomorrow to see if I can
replicate the failure.

The difference with production and staging 2 are

staging2 is running php7, produciton php5
staging2 is MariaDb 10.1 (and I also converted all the tables to utf8mb4),
production still has mostly latin formatted tables.

staging2 data is about 2weeks ago snapshot of production.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:10&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: reopened
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by robe):

I restored backup from last night onto staging2. And now staging2 is
exhibiting the same issue as production with the member map page not
showing any points.

I then applied my utf8mb fix just to make sure that wasn't the difference
and it was still broken.

So whatever broke member map was probably recent member data added from
within past 2 weeks.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:11&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: reopened
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by robe):

GI made same changes to members related file and committed fix to repo
(files used by members map were different)

roots/assets/vue/item-map.vue
roots/assets/js/bundle.js

I put the changes in production and see the map icons now on members

https://www.osgeo.org/community/members/

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:12&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: closed
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution: fixed
Keywords: |
---------------------+--------------------------------------
Changes (by robe):

* status: reopened => closed
* resolution: => fixed

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:13&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: reopened
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------
Changes (by jive):

* status: closed => reopened
* resolution: fixed =>

Comment:

Integration is still not working:

1. Members map shows one user for Mexico
2. Mexico has several users, one in Mexico (country) and on win Mexico
(country) --> Mexico (city)

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:14&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#2083: map content integration not working on osgeo.org
---------------------+--------------------------------------
Reporter: jive | Owner: webcom@…
     Type: task | Status: reopened
Priority: normal | Milestone: Website rebranding 2017
Component: WebSite | Resolution:
Keywords: |
---------------------+--------------------------------------

Comment (by robe):

That sounds like it might be a data issue, like not all cities are
geocoded. I didn't check to see where it is pulling the lon/lats from but
I assume it must be in one of the location tables.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/2083#comment:15&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.