Changeset 332
- Timestamp:
- 07/28/10 01:47:29 (19 months ago)
- Location:
- Products.ATGoogleMaps/trunk/Products/ATGoogleMaps
- Files:
-
- 6 edited
-
content/GPolyline.py (modified) (2 diffs)
-
profiles/default/types/GPolyline.xml (modified) (1 diff)
-
skins/ATGoogleMaps/atgooglemaps.js.dtml (modified) (1 diff)
-
skins/ATGoogleMaps/gmap.py (modified) (3 diffs)
-
skins/ATGoogleMaps/gmap_view.pt (modified) (1 diff)
-
skins/ATGoogleMaps/latlng_widget.pt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/content/GPolyline.py
r318 r332 31 31 FloatField('opacity', 32 32 default=1.0, 33 widget=StringWidget( 34 label='Opacity', 35 label_msgid='label_opacity', 36 description_msgid='help_opacity', 37 i18n_domain='googlemaps', 38 size=8, 39 ) 33 40 ), 34 41 IntegerField('weight', 35 default=2, 42 default=5, 43 widget=StringWidget( 44 label='Weight', 45 label_msgid='label_weight', 46 description_msgid='help_weight', 47 i18n_domain='googlemaps', 48 size=8, 49 ) 36 50 ), 51 LinesField('coordinates', 52 widget=LinesWidget( 53 label='Coordinates', 54 label_msgid='label_path', 55 description_msgid='help_path', 56 i18n_domain='googlemaps', 57 ) 58 ), 37 59 ),) 38 60 gpolyline_schema = getattr(ATCTContent, 'schema', Schema(())).copy() + schema.copy() … … 59 81 return latlng 60 82 83 # return coordinates array string 84 def getCoordinatesArray(self): 85 coordinates_array = "[" 86 for coordinate in self.coordinates: 87 coordinates_array += "[%s]," % coordinate 88 coordinates_array = coordinates_array[:-1] + "]" 89 return coordinates_array 90 61 91 registerType(GPolyline, PROJECTNAME) -
Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/profiles/default/types/GPolyline.xml
r318 r332 15 15 <property name="allowed_content_types" /> 16 16 <property name="allow_discussion">False</property> 17 <property name="default_view"> gpolyline_view</property>17 <property name="default_view">base_view</property> 18 18 <property name="view_methods"> 19 19 <!-- <element value="banner_view"/> --> -
Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/atgooglemaps.js.dtml
r298 r332 85 85 return marker; 86 86 } 87 88 function createPolyline(map, color, opacity, weight, title) { 89 var polyline = new google.maps.Polyline({ 90 strokeColor: color, 91 strokeOpacity: opacity, 92 strokeWeight: weight 93 }); 94 95 polyline.setMap(map); 96 return polyline; 97 } 98 99 function createPath(array) { 100 var mvcArray = new google.maps.MVCArray(); 101 for (var i = 0; i < array.length; i++) { 102 mvcArray.push(new google.maps.LatLng(array[i][0], array[i][1])); 103 } 104 return mvcArray; 105 } -
Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/gmap.py
r297 r332 1 1 site_encoding = context.plone_utils.getSiteEncoding() 2 2 3 def add_polylines(js, items): 4 for index in range(len(items)): 5 polyline = items[index].getObject() 6 js.append(' var polyline_%d = createPolyline(map, "%s", %f, %d, "%s");' 7 % (index, polyline.color, polyline.opacity, polyline.weight, polyline.title)) 8 js.append(' polyline_%d.setPath(createPath(%s));' % (index, polyline.getCoordinatesArray())) 9 3 10 def add_markers(js, items): 4 11 for index in range(len(items)): … … 6 13 lat = marker.point['latitude'] 7 14 lng = marker.point['longitude'] 8 js.append(' var marker_%d = createMarker(map, %s, %s, "%d", "%s");' % (index, lat, lng, index, marker.title)) 15 js.append(' var marker_%d = createMarker(map, %s, %s, "%d", "%s");' 16 % (index, lat, lng, index, marker.title)) 9 17 10 18 # create initialize method … … 16 24 )) 17 25 18 add_markers(js, context.getFolderContents()) 26 add_markers(js, context.getFolderContents({'portal_type': 'GMarker'})) 27 add_polylines(js, context.getFolderContents({'portal_type': 'GPolyline'})) 19 28 20 29 js.append('}') -
Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/gmap_view.pt
r331 r332 35 35 <!-- gmarker --> 36 36 <div class="gmarkerBox" 37 tal:define="folderContents context/getFolderContents;37 tal:define="folderContents python:context.getFolderContents({'portal_type': 'GMarker'}); 38 38 normalizeString nocall:context/@@plone/normalizeString;"> 39 39 <ul class="gmarkerBlock"> -
Products.ATGoogleMaps/trunk/Products/ATGoogleMaps/skins/ATGoogleMaps/latlng_widget.pt
r331 r332 18 18 <tal:block tal:define="latitude value/latitude | string:35.7317; 19 19 longitude value/longitude | string:139.7278; 20 zoom python:test(value, '14', '4'); 21 Iterator python:modules['Products.CMFPlone'].IndexIterator; 22 tabindex python:Iterator(mainSlot=False);"> 20 zoom python:test(value, '14', '4');"> 23 21 24 22 <span tal:replace="structure context/latlng_map" /> … … 32 30 value="" 33 31 size="12" 34 tabindex="#"35 32 tal:attributes="name string:${fieldName}.latitude:record:ignore_empty; 36 33 value latitude; 37 34 size widget/size; 38 maxlength widget/maxlength; 39 tabindex tabindex/next;" 35 maxlength widget/maxlength;" 40 36 /> 41 37 … … 48 44 value="" 49 45 size="12" 50 tabindex="#"51 46 tal:attributes="name string:${fieldName}.longitude:record:ignore_empty; 52 47 value longitude; 53 48 size widget/size; 54 maxlength widget/maxlength; 55 tabindex tabindex/next;" 49 maxlength widget/maxlength;" 56 50 /> 57 51 … … 67 61 <input class="standalone" type="button" id="s" 68 62 value="Search" 69 tabindex=""70 63 onclick="geocode();" 71 64 i18n:domain="plone" 72 65 i18n:attributes="value label_search;" 73 tal:attributes="tabindex tabindex/next;"74 66 /> 75 67 76 <div id="map_canvas" style="height: 300px; width: 400px;">68 <div id="map_canvas" style="height: 500px;"> 77 69 <div id="crosshair"></div> 78 70 </div>
Note: See TracChangeset
for help on using the changeset viewer.
