Page 3 of 4

How do I add a marker to a google map?

Posted: Sat Mar 17, 2012 7:17 pm
by maxkatz

Local file won't work.


How do I add a marker to a google map?

Posted: Sat Mar 17, 2012 8:17 pm
by Jgc

I see. Okay, can you please tell me where you are inserting your code then? I recall you said in an earlier post you dont need a geolocation component but to just use the map.....How? I dont see a way to insert code anywhere in a map component......Can you please clarify?


How do I add a marker to a google map?

Posted: Sun Mar 18, 2012 10:40 pm
by maxkatz

Geolocation component determines your current location. If you have some location already determined (latitude/longitude), then you can use that.


How do I add a marker to a google map?

Posted: Mon Mar 19, 2012 12:46 am
by Jgc

Thanks for the response, but I already knew that. What I am asking is - If I have a location already determined and I use it in this code -

var location = new google.maps.LatLng(-25.363882,131.044922);

var myOptions = {
zoom: 4,
center: location,
mapTypeId: google.maps.MapTypeId.ROADMAP
}

var map = new google.maps.Map($('div[dsid="mapa"]').get(0), myOptions);

var marker = new google.maps.Marker({
position: location,
map: map,
title:"Hello World!"
});

Do I use a component to put that code in? If not where do I put it, in order to see it in action?????


How do I add a marker to a google map?

Posted: Mon Mar 19, 2012 4:35 am
by maxkatz

You would put this code in Run Custom JavaScript action or in JavaScript file (asset) as function as then invoke it.


How do I add a marker to a google map?

Posted: Mon Mar 19, 2012 3:48 pm
by Jgc

Ok, great! Thanks!


How do I add a marker to a google map?

Posted: Wed Sep 05, 2012 9:15 am
by Haim

How do you set the icon for the marker? I want to have different Google Map marker icons for different spots (depending on POI category - example, restaurants, hotels, etc).


How do I add a marker to a google map?

Posted: Wed Sep 05, 2012 10:30 am
by Maryna Brodina

Hello! You should be able to do it with Google Maps API. This should help https://developers.google.com/maps/do... (Customizing the Marker Image), http://stackoverflow.com/questions/48...


How do I add a marker to a google map?

Posted: Tue Sep 11, 2012 10:58 pm
by Venkatesh Jujjavarapu

I am getting some product store locations using an api and displaying in screen 1 and i want the locations to be displayed in a map with markers in screen2 and i am saving their lat long in click action but how to display the map with markers of all the query results.


How do I add a marker to a google map?

Posted: Tue Sep 11, 2012 11:12 pm
by maxkatz

You do it with Google Map API. You would need to create a marker for each lat/long in your array, and then add it to the map.