maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How do I add a marker to a google map?

Local file won't work.

Jgc
Posts: 0
Joined: Wed Mar 07, 2012 8:58 pm

How do I add a marker to a google map?

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How do I add a marker to a google map?

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

Jgc
Posts: 0
Joined: Wed Mar 07, 2012 8:58 pm

How do I add a marker to a google map?

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?????

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How do I add a marker to a google map?

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

Jgc
Posts: 0
Joined: Wed Mar 07, 2012 8:58 pm

How do I add a marker to a google map?

Ok, great! Thanks!

Haim
Posts: 0
Joined: Wed Sep 05, 2012 9:15 am

How do I add a marker to a google map?

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).

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do I add a marker to a google map?

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...

Venkatesh Jujjavarapu
Posts: 0
Joined: Tue Sep 11, 2012 10:58 pm

How do I add a marker to a google map?

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How do I add a marker to a google map?

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.

Return to “Issues”