Plugin Directory

Changeset 1589379


Ignore:
Timestamp:
02/05/2017 03:31:23 PM (9 years ago)
Author:
ionutmorariu
Message:

ADD: google maps svg marker

Location:
scale-lite-tools/trunk/assets
Files:
137 added
2 edited

Legend:

Unmodified
Added
Removed
  • scale-lite-tools/trunk/assets/css/fronted.google-maps.css

    r1589292 r1589379  
    99}
    1010
    11 .material-icons {
     11.material-icons,
     12.md-icon {
    1213  font-family: 'Material Icons';
    1314  font-weight: normal;
     
    3334  font-feature-settings: 'liga';
    3435}
     36
     37#ic_place_48 {
     38  background-color: tomato;
     39  color: tomato;
     40  fill: red;
     41}
  • scale-lite-tools/trunk/assets/js/frontend.sl-google-maps.js

    r1589302 r1589379  
    1010  head.insertBefore = function (newElement, referenceElement) {
    1111    if (newElement.href && newElement.href.indexOf('https://fonts.googleapis.com/css?family=Roboto') === 0) {
    12       console.info('Prevented Roboto from loading!');
    1312      return;
    1413    }
     
    1817  if (typeof scaleLiteMapsBuffer != 'undefined' &&
    1918    typeof scaleLiteMarkersBuffer != 'undefined') {
    20     console.log(scaleLiteMapsBuffer);
    21     console.log(scaleLiteMarkersBuffer);
    2219    var geocoder = new google.maps.Geocoder();
    2320    for (var prop in scaleLiteMapsBuffer) {
     
    4441      });
    4542
    46       function addMarker(position, title) {
    47         console.log(position);
     43      function addMarker(position, title, icon) {
    4844        var marker = new google.maps.Marker({
    4945          position: position,
    5046          map: map,
    51           icon: 'console.log'
     47          icon:
     48          {
     49            path: '/wp-content/plugins/trunk/assets/map-svg-icons/ic_'+icon+'_48px.svg',
     50            scaledSize: new google.maps.Size(48, 48)
     51          }
    5252        });
    5353        var infowindow = new google.maps.InfoWindow({
     
    6565        var description = "<p>" + scaleLiteMarkersBuffer[mapObject.map_markers[
    6666          i]].description + "</p>";
     67        var marker_icon = (scaleLiteMarkersBuffer[mapObject.map_markers[
     68          i]].icon) ? scaleLiteMarkersBuffer[mapObject.map_markers[
     69          i]].icon : 'place'
    6770
    68         addMarker({lat: marker_lat, lng: marker_lng}, title+description);
     71        addMarker({lat: marker_lat, lng: marker_lng}, title+description, marker_icon);
    6972      }
    7073  }
Note: See TracChangeset for help on using the changeset viewer.