Do we have any option for display google map marker in right side position instead of center point -
do have option display google map marker in right side position instead of center point html
<div id="map_32" style="width:100%; height: 500px;"></div>
javascript
google.maps.event.adddomlistener(window, 'load', initialize); function initialize() { var lan = 11.4602 var lat = 47.7493 var infowindowcontent = "info content"; var zoom = 14; createmap( lat, lan,zoom,infowindowcontent ); } function createmap(lat, lng, zoomval,infowindowcontent ) { var infotext_32 = infowindowcontent; infotext_32 = decodeuricomponent(infotext_32); infotext_32 = infotext_32.replace(/\+/g, ' '); // split infotext rows var rowsinfotext_32 = infotext_32.split("<br>"); var latlng_32 = new google.maps.latlng(lat,lng); var mapoptions_32 = new object(); mapoptions_32.center = latlng_32; mapoptions_32.zoom = zoomval; mapoptions_32.maptypeid = google.maps.maptypeid.roadmap; mapoptions_32.navigationcontroloptions = new object(); mapoptions_32.navigationcontroloptions.style = google.maps.navigationcontrolstyle.default; mapoptions_32.scrollwheel = true; //myoptions.navigationcontroloptions = {style: google.maps.navigationcontrolstyle.small}; var mapcenter_32 = new object(); mapcenter_32.position = latlng_32; mapcenter_32.title = rowsinfotext_32[0]; mapcenter_32.icon = 'map-icon.png'; var map_32 = new google.maps.map(document.getelementbyid(""), mapoptions_32); var marker_32 = new google.maps.marker(mapcenter_32); // set info window if ('' != infotext_32){ infotext_32 = infotext_32.replace(/\n/g, "<br>"); var infobox_32 = new object(); infobox_32.content = infotext_32; var infowindow_32 = new google.maps.infowindow(infobox_32); // add listener google.maps.event.addlistener(marker_32, 'click', function(){openinfowindow_32();}); } if (true == '') { // show map, open infobox , center view google.maps.event.addlistener(map_32, 'tilesloaded', function(){google.maps.event.trigger(marker_32, 'click');}); } marker_32.setmap(map_32); function openinfowindow_32(){ infowindow_32.open(map_32,marker_32); } }
how cant set our marker in right side position in google map
let me know if proper clue
there way define marker offset in google maps.
var marker = new google.maps.marker({ position:new google.maps.latlng(36,-80), icon: { url: 'images/beachflag.png', size: new google.maps.size(20, 32), // origin image 0,0. origin: new google.maps.point(0,0), // anchor image base of flagpole @ 0,32. anchor: new google.maps.point(0, 32) } //more attributes });
this taken directly example on given url.
essentially, object attributes image source (url
), , size, origin , positioning values. pretty straight forward. having marker on left side of marker, use anchor: new google.maps.point(32,32)
, or height , width of image. image on right side of marker (like example), use anchor: new google.maps.point(0,32)
, or 0
, height of marker.
Comments
Post a Comment