my code given below. working if uncomment icon line ( //icon: 'http://108.163.162.202:8080/finex/img/map_marker.png'), marker , title not display.
i want add custom marker in page , code not allowing me.
please thank in advance
$(function() { var locations = [ ['jersey city', 40.7178746, -74.0718356], ['bronx', 40.8504989, -73.84934,5 ], ['union city', 40.7667435, -74.0303289], ['queens', 40.651018, -73.871192], ['ridgefield', 40.8256436, -74.0153092] ]; var map = new google.maps.map(document.getelementbyid('map'), { zoom: 11, center: new google.maps.latlng(40.7590615, -73.969231), maptypeid: google.maps.maptypeid.roadmap, scrollwheel: false, maptypecontrol: false, scalecontrol: false, navigationcontrol: true, draggable: false, zoomcontroloptions: { style: google.maps.zoomcontrolstyle.large }, }); var infowindow = new google.maps.infowindow(); var marker, i; (i = 0; < locations.length; i++) { marker = new google.maps.marker({ position: new google.maps.latlng(locations[i][1], locations[i][2]), map: map, title: locations[i][0], //icon: 'http://108.163.162.202:8080/finex/img/map_marker.png', }); google.maps.event.addlistener(marker, 'click', (function(marker, i) { return function() { infowindow.setcontent(marker.title); infowindow.open(map, marker); } })(marker, i)); } });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> <div style="height:300px;width:500px;" id="map"></div>
i did in project <input type="hidden" value="http://108.163.162.202:8080" id="baseurl" > var baseurl=$('#baseurl').val(); icon: new google.maps.markerimage( baseurl+'images/marker-new.png', null, null, // new google.maps.point(0,0), null, new google.maps.size(36, 36) ),
Comments
Post a Comment