singlow / meteor-live-maps

Live map markers for google maps.
10 stars 5 forks source link

title not showing up #4

Open doubletaketech opened 9 years ago

doubletaketech commented 9 years ago

I'm using a svg icon. For some reason, I can't get the marker title to show up. The value exists in the document object, but it just doesn't display. I want the 3 digit umsNumber to appear below the custom marker.

Any ideas?

 var liveMarkers = LiveMaps.addMarkersToMap(
                        map,
                        [{
                            cursor: Meters.find({projectId: Session.get('selectedProjectId')}),
                            onClick: function() {
                                Session.set('selectedMeterId',this.id);
                                $('#mapModal').modal('show');
                            },
                            transform: function (document) {
                                return {
                                    title: document.umsNumber,
                                    position: new google.maps.LatLng(document.lat, document.lon),
                                    icon: {
                                        path: 'M265.359,615.639h81.282c-1.594,11.953-6.175,21.914-13.746,29.885c-7.57,7.969-16.535,11.951-26.895,11.951c-10.36,0-19.325-3.982-26.895-11.951C271.535,637.553,266.953,627.592,265.359,615.639z M245.637,599.502h120.727l5.379-44.227H239.66L245.637,599.502z M473.343,300.674c0,43.43-14.744,81.082-44.227,112.957c-0.4,0.398-1.197,1.395-2.393,2.988c-1.992,3.186-3.984,6.574-5.977,10.16c-4.781,8.367-9.365,17.73-13.746,28.09c-4.381,10.358-8.166,20.719-11.354,31.078c-0.797,0.996-1.396,2.789-1.793,5.379s-0.797,4.283-1.194,5.08c-0.398,0.797-0.697,2.092-0.896,3.885c-0.199,1.793-0.3,2.689-0.3,2.689v0.896v15.539v19.125h-19.125H356.8H255.198h-15.539h-19.125v-19.125v-15.539l-0.299-2.092c-0.199-1.395-0.697-3.686-1.494-6.873c-0.797-3.189-1.594-6.176-2.391-8.965c-3.187-10.359-6.972-20.721-11.355-31.078c-4.382-9.562-9.363-19.324-14.941-29.285c-2.39-3.984-4.582-7.371-6.574-10.16c-0.398-0.797-0.996-1.793-1.793-2.988v-0.598c-28.687-31.476-43.031-68.531-43.031-111.164c0-45.82,16.436-84.966,49.307-117.439S260.18,134.525,306,134.525c45.82,0,85.165,16.238,118.036,48.71C456.907,215.707,473.343,254.854,473.343,300.674z M435.094,300.674c0-35.461-12.648-65.642-37.951-90.545c-25.301-24.903-55.682-37.354-91.143-37.354s-65.841,12.452-91.142,37.354c-25.301,24.902-37.951,55.084-37.951,90.545c0,32.672,10.957,61.16,32.871,85.465c1.594,1.992,3.785,4.781,6.574,8.367c1.992,3.586,4.183,7.57,6.574,11.953c6.375,11.156,11.953,22.113,16.734,32.871c5.18,11.555,9.762,23.309,13.746,35.262c3.188,11.156,4.981,19.723,5.379,25.699h94.43c0.4-5.975,2.191-14.543,5.379-25.699c3.586-11.953,7.969-23.707,13.148-35.262s10.357-22.114,15.539-31.676c2.391-3.984,4.98-7.971,7.77-11.953c2.393-3.984,4.383-6.773,5.979-8.367C423.74,363.029,435.094,334.143,435.094,300.674z M336.479,346.694l-16.734-33.47L306,286.33l-13.746,26.895l-16.734,33.47l-16.734-33.47l-26.895,13.746l30.48,60.363l13.148,27.492l13.746-27.492L306,353.865l16.734,33.469l13.746,27.492l13.146-27.492l30.48-60.363l-26.896-13.746L336.479,346.694z',
                                        fillColor: document.status,
                                        fillOpacity: .8,
                                        strokeColor: '',
                                        strokeWeight: 0,
                                        scale: 0.05
                                    }

                                };
                            }
                        }]
                    );

screen shot 2014-12-12 at 3 50 49 pm

doubletaketech commented 9 years ago

Let me clarify. I assumed title was a label next to the marker. It may or may not be that exactly.

singlow commented 9 years ago

Does the title appear as a tooltip? That is what I would expect based on the google api docs.

Maybe you need to do something a bit more involved to display the text on the map:

http://stackoverflow.com/questions/11096094/google-maps-v3-marker-with-label