Index: branches/SemanticMaps0.8/includes/services/OpenLayers/SM_OpenLayers.php |
— | — | @@ -31,6 +31,7 @@ |
32 | 32 | ), |
33 | 33 | 'messages' => array( |
34 | 34 | 'semanticmaps_enteraddresshere', |
| 35 | + 'semanticmaps-updatemap', |
35 | 36 | 'semanticmaps_lookupcoordinates', |
36 | 37 | 'semanticmaps-forminput-remove', |
37 | 38 | 'semanticmaps-forminput-add', |
Index: branches/SemanticMaps0.8/includes/services/OpenLayers/jquery.openlayersinput.js |
— | — | @@ -19,6 +19,19 @@ |
20 | 20 | 'size': options.fieldsize |
21 | 21 | } ); |
22 | 22 | |
| 23 | + var updateButton = $( '<button />' ).text( mediaWiki.msg( 'semanticmaps-updatemap' ) ); |
| 24 | + |
| 25 | + updateButton.click( function() { |
| 26 | + // TODO |
| 27 | + return false; |
| 28 | + } ); |
| 29 | + |
| 30 | + input.keypress( function( event ) { |
| 31 | + if ( event.which == '13' ) { |
| 32 | + updateButton.click(); |
| 33 | + } |
| 34 | + } ); |
| 35 | + |
23 | 36 | var geofield = $( '<input />' ).attr( { |
24 | 37 | 'type': 'text', |
25 | 38 | 'id': mapDivId + '_geofield', |
— | — | @@ -41,13 +54,19 @@ |
42 | 55 | } |
43 | 56 | } ); |
44 | 57 | |
45 | | - var button = $( '<input />' ).attr( { 'type': 'submit', 'value': mediaWiki.msg( 'semanticmaps_lookupcoordinates' ) } ); |
| 58 | + var geoButton = $( '<button />' ).text( mediaWiki.msg( 'semanticmaps_lookupcoordinates' ) ); |
46 | 59 | |
47 | | - button.click( function() { |
| 60 | + geoButton.click( function() { |
48 | 61 | geocodeAddress( $( '#' + mapDivId + '_geofield' ).attr( 'value' ) ); |
49 | 62 | return false; |
50 | 63 | } ); |
51 | 64 | |
| 65 | + geofield.keypress( function( event ) { |
| 66 | + if ( event.which == '13' ) { |
| 67 | + geoButton.click(); |
| 68 | + } |
| 69 | + } ); |
| 70 | + |
52 | 71 | var mapDiv = $( '<div />' ) |
53 | 72 | .attr( { |
54 | 73 | 'id': mapDivId, |
— | — | @@ -58,10 +77,10 @@ |
59 | 78 | 'height': options.height |
60 | 79 | } ); |
61 | 80 | |
62 | | - this.html( $( '<p />' ).append( input ) ); |
| 81 | + this.html( $( '<p />' ).append( input ).append( updateButton ) ); |
63 | 82 | |
64 | 83 | if ( options.geonamesusername != '' ) { |
65 | | - this.append( $( '<p />' ).append( geofield ).append( button ) ); |
| 84 | + this.append( $( '<p />' ).append( geofield ).append( geoButton ) ); |
66 | 85 | } |
67 | 86 | |
68 | 87 | this.append( mapDiv ); |
— | — | @@ -151,8 +170,9 @@ |
152 | 171 | |
153 | 172 | mapDiv.map.panTo( location ); |
154 | 173 | |
155 | | - location.transform( new OpenLayers.Projection( "EPSG:900913" ), new OpenLayers.Projection( "EPSG:4326" ) ); |
156 | | - $( '#' + mapDivId + '_values' ).attr( 'value', semanticMaps.buildInputValue( [ location ] ) ); |
| 174 | + var normalProjectionLocation = new OpenLayers.LonLat( location.lon, location.lat ); |
| 175 | + normalProjectionLocation.transform( new OpenLayers.Projection( "EPSG:900913" ), new OpenLayers.Projection( "EPSG:4326" ) ); |
| 176 | + $( '#' + mapDivId + '_values' ).attr( 'value', semanticMaps.buildInputValue( [ normalProjectionLocation ] ) ); |
157 | 177 | } |
158 | 178 | |
159 | 179 | return this; |
Index: branches/SemanticMaps0.8/SemanticMaps.i18n.php |
— | — | @@ -26,9 +26,10 @@ |
27 | 27 | 'semanticmaps-default-kml-pagelink' => 'View page $1', |
28 | 28 | |
29 | 29 | // Forms |
| 30 | + 'semanticmaps-loading-forminput' => 'Loading map form input...', |
30 | 31 | 'semanticmaps_lookupcoordinates' => 'Look up coordinates', |
31 | 32 | 'semanticmaps_enteraddresshere' => 'Enter address here', |
32 | | - 'semanticmaps-loading-forminput' => 'Loading map form input...', |
| 33 | + 'semanticmaps-updatemap' => 'Update map', |
33 | 34 | 'semanticmaps_notfound' => 'not found', |
34 | 35 | 'semanticmaps-forminput-remove' => 'Remove', |
35 | 36 | 'semanticmaps-forminput-add' => 'Add', |