July 28, 201511 yr <script type="text/javascript"> $(document).ready(function(){ new GMaps({ el: '#map1', lat: 51.74673, lng: -0.26595, }); }); </script> From reading the docs, it doesn't really show me how to incorporate a marker into my script: http://hpneo.github.io/gmaps/examples/markers.html I feel this is a little bit over my head... Could somebody please help (I just want a normal marker with "company name") Thankyou Edited July 28, 201511 yr by Benn_Kingy
July 28, 201511 yr There's a bit of code on that page which will put the marked in for you: map.addMarker({ lat: -12.043333, lng: -77.028333, title: 'Lima', click: function(e) { alert('You clicked in this marker'); } }); Just change the co-ordinates where you want the marker. Not tried it myself, but that looks like your answer! Let me know how it goes
July 28, 201511 yr Author There's a bit of code on that page which will put the marked in for you: map.addMarker({ lat: -12.043333, lng: -77.028333, title: 'Lima', click: function(e) { alert('You clicked in this marker'); } }); Just change the co-ordinates where you want the marker. Not tried it myself, but that looks like your answer! Let me know how it goes where/how does that go in my script though?! thats what i got stuck on thankyou Edited July 28, 201511 yr by Benn_Kingy
July 29, 201511 yr where/how does that go in my script though?! thats what i got stuck on thankyou Give this a go: <script type="text/javascript"> $(document).ready(function(){ new GMaps({ el: '#map1', lat: 51.74673, lng: -0.26595, }); map.addMarker({ lat: -12.043333, lng: -77.028333, title: 'Lima', click: function(e) { alert('You clicked in this marker'); } }); }); </script> This should work - look at the source code of that page in the header to see how they done it for the demo map, and that'll get you going in the right direction
Create an account or sign in to comment