Download & Extend

Broken image of marker in map when Drupal translation paths are used.

Project:OpenLayers
Version:7.x-2.x-dev
Component:OL Styles
Category:bug report
Priority:normal
Assigned:Unassigned
Status:patch (to be ported)

Issue Summary

Hi

trying to change the image of marker but getting broker (like image not found) on the map
please view the attachment.
all the path to img styles and file located in correct directory.

please advice.

AttachmentSizeStatusTest resultOperations
broken.png66.63 KBIgnored: Check issue status.NoneNone

Comments

#1

Version:7.x-3.x-dev» 7.x-2.x-dev

I have the same problem.

@martin.riggs by any chance is your site a multi-lingual site?

It works fine for me when the language is set to the default language english.

Path example:
domain.tld/sites/all/modules/contrib/openlayers/theme/default_dark/img/marker-red.png

But when I switch the language to French, which uses a prefix folder, I get this path for the image which is a 404
domain.tld/fr/sites/all/modules/contrib/openlayers/theme/default_dark/img/marker-red.png

The /fr/ appears to be the problem. Most likely the Javscript used in this module isn't setting up the paths right. This might also be a problem for you if your Drupal is installed in a sub-folder I'm guessing

#2

Title:Broken image of marker» Broken image of marker in map when Drupal translation paths are used.

Adding a better title.

#3

Status:active» needs review

I've attached a patch, which adds base_url() to the externalGraphic paths.

@martin.riggs Please apply it and see if it works for you.

AttachmentSizeStatusTest resultOperations
openlayers-fix-marker-lang-path-1404912-3.patch1.57 KBIdlePASSED: [[SimpleTest]]: [MySQL] 236 pass(es).View details | Re-test

#4

Thank, but please don't be mad on me, i never applied patches
could you guide me in few lines how to do it ?
i actually could follow the diffs by if there some better way i would like to know..
and thanks again...

#5

If you've downloaded the module through git, you go into the module folder and `git apply -v PATCH.patch`

If you've simply downloaded the source, you do `cd sites/all/modules/openlayers; patch -p1 < PATCH.patch`

the `patch` command is with linux. If you're using mac or windows, you''ll have to do some reading for those OS's

Here's more information http://drupal.org/node/707484. Usually a quick google will solve these problems for you.

#6

Status:needs review» needs work

I'd go with file_create_url() instead of base_path(), it's the same issue we had with URL using ${dynamic}.

#7

Actually, try this patch instead #1364778: openlayers_style_path() must not use url() to create file paths. and tell me if it fixes the problem.

#8

I worked thanks

#9

Status:needs work» fixed

I'll commit the patch later, unless there is still an issue here.

#10

ok, thanks, i will wait for your update, meanwhile i working with default style.

#11

Status:fixed» closed (fixed)

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

#12

Sorry but this only works with clean urls.

If you can't use clean urls this patch won't work. It tries to get the image from:
localhost/?q=sites/all/modules/openlayers/themes/default_dark/img/marker-blue.png

the ?q= breaks the url.

Thanks

#13

Status:closed (fixed)» active

upps forgot to reopen

Sorry but this only works with clean urls.

If you can't use clean urls this patch won't work. It tries to get the image from:
localhost/?q=sites/all/modules/openlayers/themes/default_dark/img/marker-blue.png

the ?q= breaks the url.

Thanks

#14

Does the patch in #7 fixes this ? I'm sorry haven't got around committing it yet.

#15

Status:active» closed (fixed)

Sorry. You are right.

I was using the old patch, the one that doesn't use the file_create_url()

Thanks.

#16

Status:closed (fixed)» patch (to be ported)

This is still in the current versions over a year later. Can this be rolled in?

nobody click here