The map on the home page is not working

Hello Omeka developers,

On the home page in the map section, when an object is selected from the dropdown list, no pins or any changes to the map are displayed.
If you can help me or have had the same problem, please send suggestions.
The selected theme on the omeka is Curatescape Echo.

Hi @Korisnik, can you provide some additional information please. Are you seeing any errors in your browser JavaScript console? What versions of Omeka/theme/plugins are you using (click system information at the bottom of the admin dashboard to find this info)? Can you share a link?

I am using Curatescape Echo theme version 1.4.9 and Curatescape JSON plugin has version 1.5.1.
I am sending you a picture of the console and the displayed errors

The home page loads the map but doesn’t show the pins.

It looks like you have the site installed in a subdirectory (example.com/app). The issue is that the map script is looking for the map data at /items/browse?output=mobile-json instead of /app/items/browse?output=mobile-json

If you move the installation to a subdomain (app.example.com), it will likely fix the issue.

Or you can fiddle around with the .htaccess file to make sure the relative link paths are correct (example).

I still haven’t been able to solve the problem.
Is it possible to change the path leading to the objects in the code?

You could try editing the data-json-source attribute on the map figure, which is in the rl_homepage_map() function in custom.php, line 791 (at least in v.1.5.1). Note that if you edit the theme directly, you’ll need to do this each time you apply a theme update.

Hello
We tried to edit the attribute as you suggested, but there was no change.

Just to point out that only in this theme the pins do not appear on the map, while in all the others it works normally (for example Freedom).
I’m sending you photos.


Ok, my mistake, looks like you actually need to edit the loadMapMulti() function in the file at /javascripts/multi-map.js. As shown below, add /app to the data source path.

dataSource = isGlobalMap
    ? window.location.protocol +
      "//" +
      window.location.hostname +
      "/app/items/browse" +
      jsonPath
    : url + jsonPath;

Again there was no change.

I am sending an image of the multi-map.js file.
When we start the debugger, it pauses on the fetch() method.

I think you’ll need to continue studying the code. Find all the places where the JSON data source is constructed and/or passed as a variable and change the path from /items... to /app/items... to match your installation location.

The markerFetchAndAdd() function is called in two different scenarios – when the map loads the first time via the loadMapMulti() function, and when you swap out the markers by selecting a subject term from the dropdown, which fires the markerReset() function.

The debugger stopped when you tried to fetch data from an invalid source inside the markerFetchAndAdd() function. Use console.log(dataSource) inside that function before the breakpoint and you’ll see an incorrect path. Find the 2 places where markerFetchAndAdd() is called and make sure the dataSource variable being passed into the function is correct. If it’s not, fix it.

There may be other places where you need to adjust the path, I’m not sure. As I mentioned before, the best and easiest way to fix this is to just not serve the site in a subdirectory. I understand that may not be an ideal option for every project, but it’s a current limitation of the Curatescape themes.