Google Maps - Hot Spots - Events for vbaCMPS
This modification is in the archives.
This is my first contribute to everyone here so if you could click install so that i further add to this.
Here is a LIVE working demo. minus the added pictures and colored markers which is an addiontal install. Insutructions listed below. http://www.jerseyparties.com/index.php?page=googlemap Im using this with vb 3.5.1 and vbadvanced cmps 2.1 Google Maps with Hot Spots - Events for CMPS ******** You will need your own Google API Map Key for this to work. You can get it by going here:https://www.google.com/apis/maps/signup.html ***Install: Add a module as you normally would, and copy the below into the template content. To create a module vBa CMPS > add module > template > then give it any title you want and display order Then give it a name I called my "googlemaps" so the name is now "adv_portal_googlemaps" ******** note google maps do slow down load times ********* Copy the below and place it into the template content. After you have your Google API Map Key enter it where it says "Enter_Your_Key_Here " Should be around line 7 or so. PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Ive been using this site to convert an address to the proper latitude and longitude. http://stevemorse.org/jcal/latlon.php - for US locations http://www.geocoder.ca/ - for Canadian locations Adding Different color markers. If you want to add different color markers, line 10 should read: PHP Code:
var icon0;
PHP Code:
var icon1;
Then after you have added that you will need to add this: This will have to be added for each marker you add. Add this right below the first marker. Should be around line 46 or so. PHP Code:
icon1 = new GIcon();
Each time you want to use a different marker you have to call to that variable/marker. So in the example I have: PHP Code:
newpoints[0] = new Array(-74.084375, 40.917748, icon0, 'Austins Restaurant/ Junkyard Nightclub', '<div id="popup">Austins Restaurant/ Junkyard Nightclub<br />352 West Passaic Street<br />Rochelle Park, NJ 07662</div>');
PHP Code:
newpoints[0] = new Array(-74.084375, 40.917748, icon1, 'Austins Restaurant/ Junkyard Nightclub', '<div id="popup">Austins Restaurant/ Junkyard Nightclub<br />352 West Passaic Street<br />Rochelle Park, NJ 07662</div>');
You can add image to the pop up windows as well. See picture attached. In a call to variable where it says: PHP Code:
newpoints[0] = new Array(-74.084375, 40.917748, icon1, 'Austins Restaurant/ Junkyard Nightclub', '<div id="popup">Austins Restaurant/ Junkyard Nightclub<br />352 West Passaic Street<br />Rochelle Park, NJ 07662</div>');
PHP Code:
'<div id="popup">
PHP Code:
</div>');[/
To add this to its own CMPS Page Follow these directions and skip number 7, because I set this up as a template file and not a php file. http://www.vbadvanced.com/membersarea.php?do=viewusermanual&productid=4&pageid=6 Then whatever you called your page in the immediate above directions from vbA under "page identified" ( i used googlemap ) edit your navbar and inclue to a link to that page. Mine is PHP Code:
/forums/index.php?page=googlemap
*** added screen shots *** First shows the installed look. Second picture shows the popup window when a marker is clicked Third shows the addiontal useage of colored markers. Code is listed above but not in the orginal install. Fourth Picture shows the popup window with added images. How to is listed above but not in the orginal install. Download No files for download. Screenshots
|