Home › Forums › Bee WordPress Theme › Custom Google Map Pin
- This topic has 8 replies, 2 voices, and was last updated 12 years, 2 months ago by
sasquatch.
-
AuthorPosts
-
April 3, 2014 at 3:17 pm #2892
sasquatch
ParticipantHi there,
Does anyone know how to make a custom Google Map Pin instead of the default red one?
Many thanks for any help 🙂
April 4, 2014 at 1:05 am #2899Johnny
ParticipantHi, you can customize the marker style from here in file bee/js/google.map.core.js:
if(pin == 't'){ var marker = new google.maps.Marker({ position: latlng, map: google_map }); marker.setAnimation(google.maps.Animation.BOUNCE); }Best
April 5, 2014 at 7:09 pm #2912sasquatch
ParticipantOk I did this but the map disappears.. any ideas?
if(pin == 't'){ var icon = 'image url here' }; var marker = new google.maps.Marker({ position: latlng, map: google_map icon: icon }); marker.setAnimation(google.maps.Animation.BOUNCE); } } });Thanks
April 6, 2014 at 12:51 am #2913Johnny
ParticipantHi, try this please:`if(pin == ‘t’){
var marker = new google.maps.Marker({
position: latlng,
map: google_map,
icon: “http://domain.com/img/icon.png”
});
marker.setAnimation(google.maps.Animation.BOUNCE);
}`
BestApril 7, 2014 at 2:15 pm #2925sasquatch
ParticipantThanks but the map still disappears?
This is the exact code I have:
jQuery(document).ready(function() { if(jQuery('.module-map-canvas').length > 0){ jQuery('.module-map-canvas').each(function(index, element) { var _this = jQuery(this); var l = Number(_this.data('l')); var r = Number(_this.data('r')); var zoom = Number(_this.data('zoom')); var pin = _this.data('pin'); var view = _this.data('view'); map_initialize(element, l, r, zoom, pin, view); }); } function map_initialize(element, l, r, zoom, pin, view) { var geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(l, r); var markers = []; var map_type; switch(view){ case 'map': map_type = google.maps.MapTypeId.ROADMAP; break; case 'satellite': map_type = google.maps.MapTypeId.SATELLITE; break; case 'map_terrain': map_type = google.maps.MapTypeId.TERRAIN; break; } var mapOptions = { zoom: zoom, center: latlng, mapTypeId: map_type } var google_map = new google.maps.Map(element, mapOptions); if(pin == ‘t’){ var marker = new google.maps.Marker({ position: latlng, map: google_map, icon: “http://www.my-logo-url.png” }); marker.setAnimation(google.maps.Animation.BOUNCE); } } });April 7, 2014 at 11:23 pm #2933Johnny
ParticipantHi, please leaving your site url here please, I will check it for you later,
Thank youApril 8, 2014 at 12:43 am #2937sasquatch
ParticipantThis reply has been marked as private.April 8, 2014 at 1:22 am #2941Johnny
ParticipantHi, you are using wrong quotation marks in file google.map.core.js, please update this file with attached please,
BestApril 8, 2014 at 2:32 am #2944sasquatch
ParticipantWorks! Awesome.. Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.
