egoselfaxis
asked on
Need help adding 2 additional markers to embedded Google Map using API
I need to figure out how to add some additional markers to the embedded google map that's on this page:
http://benderslandingestates.com/contact.html
I've already figured out how to add the image overlays that display the addresses when clicked. All I have to do is add an additional unordered list item similar to the following and then change it's X and Y coordinates and the image file name:
What I can't seem to figure out is how to insert some additional red markers by updating the Javascript:
http://benderslandingestates.com/js/jquery.rd-google-map.js
The section that needs to be re-written -- I suspect -- is the following:
.. but I'm not entirely sure. Can anyone here be of any assistance? How would I add - say - 2 additional X / Y coordinates to the Javascript so that it shows 2 additional markers in the embedded Google map?
Thanks,
-- Yvan
http://benderslandingestates.com/contact.html
I've already figured out how to add the image overlays that display the addresses when clicked. All I have to do is add an additional unordered list item similar to the following and then change it's X and Y coordinates and the image file name:
<li data-x="-95.380427" data-y="30.115507" data-basic="images/BLE-map-marker.png" data-active="images/gmap_marker_active.png">
<p>3440 Riley Fuzzel Rd, Suite 150, Spring, TX 77386 <span>Call 281-364-7440</span></p>
</li>
What I can't seem to figure out is how to insert some additional red markers by updating the Javascript:
http://benderslandingestates.com/js/jquery.rd-google-map.js
The section that needs to be re-written -- I suspect -- is the following:
defaults = {
map: {
x: -95.3726757,
y: 30.1183008,
zoom: 13
},
locations: []
};
.. but I'm not entirely sure. Can anyone here be of any assistance? How would I add - say - 2 additional X / Y coordinates to the Javascript so that it shows 2 additional markers in the embedded Google map?
Thanks,
-- Yvan
ASKER
I'd already tried that .. meaning adding an array of locations to the existing Javascript. But no additional markers were displayed on the map after I made the changes. What doesn't make sense is that I currently have no locations specified .. yet the X and Y coordinates that are already being specified are resulting in the expected single marker. Is there no way to simply add some additional X and Y coordinates?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A ha !!! Guess what I just discovered. That little round red marker that I'm seeing plotted on map is actually in the alpha transparent image! This whole time, I was certain that it was being added there using javascript! No wonder I've been spinning my wheels!
http://benderslandingestates.com/images/BLE-map-marker.png
So I guess it really is as simple as just adding the additional list items and changing the coordinates and image URLs.
Thanks for your help and your time Scott,
-- Yvan
http://benderslandingestates.com/images/BLE-map-marker.png
So I guess it really is as simple as just adding the additional list items and changing the coordinates and image URLs.
Thanks for your help and your time Scott,
-- Yvan
Review the api https://developers.google.com/maps/documentation/javascript/markers and find the "complex" example
Open in new window
The link to example is confusing, it is below, not above that bit of code https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/javascript/examples/icon-complexThat example uses beaches[] instead of locations[]. The point is to add your data there.