Closed (fixed)
Project:
Openlayers
Version:
6.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
16 Sep 2009 at 13:04 UTC
Updated:
16 May 2024 at 00:50 UTC
Jump to comment: Most recent
Comments
Comment #1
zzolo commentedCan you link us to what file you downloaded? Is is it one file, or multiple? What controls did you hae trouble with? If you see a map at all, I doubt there is a permission problem.
Comment #2
Anonymous (not verified) commentedI right-clicked on the 'Link to the hosted version' link and went 'Save link as...' (i.e. http://openlayers.org/api/OpenLayers.js, just the one file).
I did see a map, but the Google logo was appearing in the top-left corner, and there was no navigation arrows, zoom bar or + button to change layers, even though all these were enabled in the Preset UI...
Comment #3
tmcw commentedJust an OpenLayers.js isn't enough for maps to work - it'll look on your server for css & images, and won't find them. It's best to either download the entire library from OpenLayers.org or to use the hosted version on openlayers.org.
Comment #4
zzolo commentedWe should make sure to note this in the settings page where you can change where openlayer.js comes from.
Comment #5
Anonymous (not verified) commentedAh, that makes sense. Sorry for the confusion.
Some more instructions would be good ;)
Comment #6
zzolo commentedUpdated: http://drupal.org/cvs?commit=265912
Comment #8
markabur commentedThe instructions should also mention that javascript optimization in admin/setting/performance needs to be *off* to avoid broken img links.
Comment #9
phayes commentedmarkabur, could you provide more details? This sounds like a bug, not an instructions issue.
Comment #10
tmcw commented@phayes, it's kind of a bug, but not really. OpenLayers.js will look for images relative to itself, not relative to the site root or anything else. Compressing it changes the location of the OpenLayers.js code, so it'll look in the wrong place. The documentation should say that if javascript compression is on, ImgPath and ThemePath will need to be set or controls & the dragpan control will break. Note that the best practice here is actually to use an already-minified OpenLayers.js, since compressing it is a tough task for Drupal.
Comment #11
markabur commentedthanks tom, yes, that's it exactly. it's an issue that i ran into and *could* be helped with a note in the docs, which is why i re-opened this one... but now that you point it out i see the imagepath setting that's there to take care of this.
Comment #12
zzolo commentedhttp://drupal.org/cvs?commit=327630
Changed drupal_add_js() for library to not aggregate. I also added more text to suggest a compressed version of the library. This seems like a better solution than ensuring that all presets have the correct image and css path.
Comment #13
tmcw commentedI've committed more clear documentation for OpenLayers builds and the possible interactions with the image path and css path variables. Since this is a nonfunctional change, here's a screenshot. Marking as needs review, let me know if more is needed.
http://skitch.com/tmcw/nsrhj/openlayers-localhost
Comment #14
markabur commentedre: #13, i think the explanation of what's needed in addition to the js file is ok, but it's not clear how i would "point OpenLayers to a valid image path and css path." since the sentence is talking about a downloaded copy of the js file, i'd expect to configure those paths inside that file.
Comment #15
tmcw commentedChanged it to
does that sound clearer?
Comment #16
markabur commentedi think so, yes.
Comment #17
tmcw commentedGreat, setting as fixed.
Comment #19
sbauch commentedStill not clear enough for me, unfortunately. I've downloaded the library from openlayers.org, placed the /img and /lib directories and OpenLayers.js in my root folder, and updated the OpenLayers settings to point to the OpenLayers.js in the root directory. 2 points of confusion: I have java optimization on, but am still unsure what to designate as the image and css paths on the individual map presets, and i don't know where to implement:
script type="text/javascript" src="OpenLayers.js" (removed the < />)
Can someone help me out? The issue I want to solve is load time, and I'm assuming this will help, as it seems to me that they openlayers js takes the longest to load, 6+ seconds. I have a map on my homepage with 100+ markers, and need it to load much quicker. I would be fine with the rest of the page loading first followed by the map, but don't know how to do that either (tried module weight).
Comment #20
john_the_noob commentedIs there a "right" folder to place the local openlayers.js so that it will just work ? Or can i download the whole thing somewhere, extract it to a folder and just use it ?
I can´t make the css etc work.
Comment #21
itserich commentedI think the area to set the file location has changed to make it central and more convenient. But I am new so perhaps I am confusing issues.
http://drupal.org/node/950738