Closed (fixed)
Project:
Openlayers
Version:
6.x-2.x-dev
Component:
OpenLayers CCK
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
13 Aug 2010 at 10:49 UTC
Updated:
16 May 2024 at 00:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
zzolo commentedHi @BWPanda. Many thanks for the patch. I am all about this, but there are a number of things not ideal with with your patch:
1) You are not using t() correctly
2) This should be in a separate JS file (unless there already is one for the CCK field)
3) You should utilize Drupal's JS settings to pass along the field name
Otherwise the idea is solid.
Comment #2
Anonymous (not verified) commentedThanks zzolo, glad you like the idea.
I've edited the patch to:
1) Use t() properly
2) Add jQuery code to existing .js file
3) Send field name and t() function output to JS settings
However, there's an issue when you have two maps on the same content type...
I have two OpenLayers maps on my Page content type ('field-location' and 'field-dummy') and the code doesn't work at all.
I ran an alert() in the .js file on 'wktField' and it outputs: 'field-location,field-dummy'. The PHP code is obviously adding the different fields to the same JS setting, but I couldn't work out how to fix it. If you can fix that for me, it should work fine.
Thanks!
Comment #3
zzolo commentedOk, committed. It is the way that PHP (drupal_add_js) does its array merges. It should be working fine:
http://drupal.org/cvs?commit=412908
Comment #5
Yanxi commentedI am wondering if it's possible to completely hide the WKT field even without the link to show it? Or it would be even better to make it an option (display or not) in the administration interface.
Comment #6
tmcw commentedYanxi: no, that currently isn't an option, but it would be simple to use CSS to hide the link in your theme.
Comment #7
zzolo commentedHi @Yanxi. @tmcw makes a good suggestion. Though this would be a nice option to have for the CCK widget, so people don't need to have to edit a theme. You can create a new issue for the feature request if you want.