Commit 944fc8303b7aa0e1cf74022c16312e9f38017972

Authored by JoenioCosta
1 parent dc22707b

ActionItem512: add custom icon to google map

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2142 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/views/search/_google_maps.rhtml
... ... @@ -6,7 +6,6 @@
6 6 </div>
7 7  
8 8 <script type='text/javascript'>
9   -
10 9 var points = {};
11 10  
12 11 function putMarker(lat, lng, title, summary) {
... ... @@ -20,7 +19,7 @@ function putMarker(lat, lng, title, summary) {
20 19 }
21 20  
22 21 var point = new GLatLng(lat, lng);
23   - var options = { 'title' : title };
  22 + var options = { 'title' : title, 'icon' : icon };
24 23 var marker = new GMarker(point, options);
25 24 map.addOverlay(marker);
26 25 GEvent.addListener(marker, 'click', function() {
... ... @@ -44,13 +43,19 @@ if (GBrowserIsCompatible()) {
44 43 map.setCenter(centerPoint, <%= GoogleMaps.initial_zoom.to_json %>);
45 44 var bounds = new GLatLngBounds();
46 45  
  46 + var baseIcon = new GIcon();
  47 + baseIcon.iconSize=new GSize(32,32);
  48 + baseIcon.shadowSize=new GSize(36,32);
  49 + baseIcon.iconAnchor=new GPoint(16,32);
  50 + baseIcon.infoWindowAnchor=new GPoint(16,0);
  51 + var icon = new GIcon(baseIcon, "/images/icons-map/enterprise.png", null, "/images/icons-map/enterprise_shadow.png");
  52 +
47 53 <%
48 54 missed = false
49 55 @results.each do |name,results|
50 56 results.each do |item|
51 57 if item.lat && item.lng
52 58 %>
53   -
54 59 putMarker(<%= item.lat.to_json %>, <%= item.lng.to_json %>, <%= item.name.to_json %>, <%= display_profile_info(item).to_json %>);
55 60 <%
56 61 else
... ...
public/images/icons-map/enterprise.png 0 → 100644

4.76 KB

public/images/icons-map/enterprise_shadow.png 0 → 100644

1.72 KB