Gmap3 - Forum

Gmap3 exchange platform

You are not logged in.

Ads
(server costs 27.50€ per month)


#1 2012-01-05 16:39:54

sam
Member
Registered: 2012-01-05
Posts: 7

[solved] addMarkers and custom icon

Hi,

I add multiple markers using the addMarkers function but i don't find any documentation to use custom icon , like with "addMarker"

my code :

  $("#gmap").gmap3(
   { action: 'init',
      options:{
      center:[47.27850107780644,-2.392616545043893],
      zoom: 14,
              mapTypeControl: true,
              mapTypeControlOptions: {
                style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
              },
              navigationControl: true,
              scrollwheel: true,
              streetViewControl: true      
      },
      events:{
              bounds_changed: function(map){
                console.log(map.getBounds().getCenter());
                var bounds = map.getBounds();
                var ne = bounds.getNorthEast();
                var sw = bounds.getSouthWest();
              }
            }
      
    },
    { action: 'addMarkers',
            markers:[
              {lat:47.2807359, lng:-2.3830308000000286, data:'my place 1',  icon:new google.maps.MarkerImage("http://www.mysite.com/static/css/img/pin1.png")},
              {lat:47.2807359, lng:-2.3830308000000286, data:'my place 2',  icon:new google.maps.MarkerImage("http://www.mysite.com/static/css/img/pin2.png")},
            ],
            marker:{
              options:{
                draggable: false
              }
            }
    }
  );

any idea ?

thanks

Last edited by sam (2012-01-05 18:05:20)

Offline

Ads
(server costs 27.50€ per month)


#2 2012-01-05 16:45:33

mrmustache
Member
Registered: 2011-12-22
Posts: 15

Re: [solved] addMarkers and custom icon

Hey Sam,

it should look like this:

marker:{
options:{
draggable: false,
icon : new google.maps.MarkerImage('yourImage.png')
}
}

Last edited by mrmustache (2012-01-05 16:45:56)

Offline

#3 2012-01-05 16:51:18

sam
Member
Registered: 2012-01-05
Posts: 7

Re: [solved] addMarkers and custom icon

thanks  but how do i set a different icon for each location ?

Offline

#4 2012-01-05 18:04:56

sam
Member
Registered: 2012-01-05
Posts: 7

Re: [solved] addMarkers and custom icon

Ok i found the solution by myself  :

  $("#gmap").gmap3(
   { action: 'init',
      options:{
      center:[47.27850107780644,-2.392616545043893],
      zoom: 14,
              mapTypeControl: true,
              mapTypeControlOptions: {
                style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
              },
              navigationControl: true,
              scrollwheel: true,
              streetViewControl: true      
      },
      events:{
              bounds_changed: function(map){
                console.log(map.getBounds().getCenter());
                var bounds = map.getBounds();
                var ne = bounds.getNorthEast();
                var sw = bounds.getSouthWest();
              }
            }
      
    },
    { action: 'addMarkers',
            markers:[
              {lat:47.2807359, lng:-2.3830308000000286, data:'name 1', options : { icon:new google.maps.MarkerImage("http://www.mysite.fr/static/css/img/pin_1.png") }},
              {lat:47.285448, lng:-2.3932360000000017, data:'name 2', options : { icon:new google.maps.MarkerImage("http://www.mysite.fr/static/css/img/pin_2.png") }}
            ],
            marker:{
              options:{
                draggable: false                
              }
            }            
    }
  );
 
});

great library !

Offline

#5 2012-08-30 13:28:51

Pimpy.T
Member
Registered: 2012-08-30
Posts: 1

Re: [solved] addMarkers and custom icon

Solved for me as well Sam, Thank you, multiple custom markers in combination with clusters using an external array of dynamicly generated data:

var panden = [ 
	{	
		lat:42.782909,	
		lng:-73.930679,	
		data:{		
			drive:false,		
			zip:3064,		
			url:"http://nl.cameloteurope.com/?id=688&level=1&guard_man=189&args=&panden_id=2881&property_id=2881&wtlive=Rotterdam1",		
			city:"Rotterdam1",		
			aantal:"2",		
			type:"Tijdelijke woonruimte",		
			typeId:"1" 	
		},	
		options:{icon: new google.maps.MarkerImage("/images/googlemarker1.png")},
	},
	{	
		lat:50.848930,	
		lng:5.688430,	
		data:{		
			drive:false,		
			zip:6211,		
			url:"http://nl.cameloteurope.com/?id=688&level=1&guard_man=367&args=&panden_id=2988&property_id=2988&wtlive=Maastricht",		city:"Maastricht",		
			aantal:"1",		
			type:"Tijdelijke werkruimte",		
			typeId:"3" 	
		},	
		options:{icon: new google.maps.MarkerImage("/images/googlemarker3.png")},
	}
]

View the live map: http://www.cameloteurope.com/google.php

Offline

#6 2012-09-20 04:03:25

arcee123
Member
Registered: 2012-09-11
Posts: 6

Re: [solved] addMarkers and custom icon

Hi,
I'm trying to do the same thing, however it appears that when the JSON comes through the JQUERY's AJAX Call, the icon does not want to show:

is there a special format to get the icons to show when coming through an AJAX Call?
Thanks.

Offline

#7 2012-09-20 04:13:35

arcee123
Member
Registered: 2012-09-11
Posts: 6

Re: [solved] addMarkers and custom icon

sorry, I hit the button to early...
I realize this subject is closed, but I didn't want to start a new thread if none were needed.
(please correct me if I'm wrong...)

I'm trying to get this to work:
http://jsfiddle.net/arcee123/S8kd3/74/

Using the formatted JSON from above, I cannot get the markers to appear in their specialized icons.

please help.
Thank you.

Offline

#8 2012-10-18 10:07:04

neokio
Member
Registered: 2012-10-18
Posts: 1

Re: [solved] addMarkers and custom icon

This gets ridiculously inefficient ...
If I have 5,000 markers but only 5 icons, it makes much more sense to declare the icons in the JS, and add a simple identifier in the JSON.

Is there a way to do something like this?

// JSON generated by PHP or whatever
var myMarkers = [
	{ lat:12.34567, lng:123.4567, data:"Blah blah", options: { icon: img1 } },
	{ lat:21.23456, lng:123.4567, data:"Blah blah", options: { icon: img2 } },
	{ lat:32.12345, lng:123.4567, data:"Blah blah", options: { icon: img3 } },
	{ lat:43.21234, lng:123.4567, data:"Blah blah", options: { icon: img1 } },
	{ lat:54.32123, lng:123.4567, data:"Blah blah", options: { icon: img2 } },
	{ lat:65.43212, lng:123.4567, data:"Blah blah", options: { icon: img3 } },
	{ lat:76.54321, lng:123.4567, data:"Blah blah", options: { icon: img1 } }
	// ... add 5000 more records here ...
	];

var img1 = new google.maps.MarkerImage('http://maps.gstatic.com/mapfiles/ridefinder-images/mm_20_red.png');
var img2 = new google.maps.MarkerImage('http://maps.gstatic.com/mapfiles/ridefinder-images/mm_20_green.png');
var img3 = new google.maps.MarkerImage('http://maps.gstatic.com/mapfiles/ridefinder-images/mm_20_blue.png');
var shadow = new google.maps.MarkerImage('http://maps.gstatic.com/mapfiles/ridefinder-images/mm_20_shadow.png');

$('#map_canvas').gmap3({
		action: 'init'
	},{
		action: 'addMarkers',
		markers: myMarkers,
		marker: {
			options:{
				// icon: markers.data.options.icon, or nothing, or what??
				shadow: myShadow
			}
		}
	}
);

Offline

#9 2015-02-21 04:17:25

Sathiya
Member
Registered: 2015-02-21
Posts: 1

Re: [solved] addMarkers and custom icon

NIce Coding ... !!!!

__________________
Arslan ( Dill E Nadan)

Offline

#10 2016-02-06 12:33:22

Karrahahu1
Member
Registered: 2016-02-06
Posts: 1

Re: [solved] addMarkers and custom icon

However it appears that when the JSON comes through the JQUERY's AJAX Call,???



Ali

Last edited by Karrahahu1 (2016-02-06 12:33:41)

Offline

#11 2017-08-09 13:30:33

ronnykinge
Member
Registered: 2017-04-06
Posts: 3,311

Re: [solved] addMarkers and custom icon

Capabilities Summary Sample – Other Job Search Documents.  Home Uncategorized How to write an introduction paragraph for a persuasive essay.  school essay help 
GTA: Chinatown Wars Built specifically for portable devices, the. Thank You Notes for Money Samples and Wording Ideas. Free personal identity papers, essays, and research papers.  common application essay help your  We work with leading partners and use cuttingedge technologies to develop. Sample Essay On The Topic Of Education System In USA. 
As Ferguson wrote, after 9/11 Huntington's model seemed to make sense of 'an.  case study depersonalization disorder  If we identify sound,. project, no matter how much pleasure and profit benefit to lowerpaid workers. With this review, we explore the practices of artsbased educational research as.

Offline

#12 2017-08-09 13:32:10

ronnykinge
Member
Registered: 2017-04-06
Posts: 3,311

Re: [solved] addMarkers and custom icon

here to download the PDF file containing sample r sum s and. Written Report Format for Citing Scientific Research Sources. The quality of your resume determines whether or not it moves from an inbox to someone's desk.  how long does a personal statement have to be for medical school  Air pollution causes effects and solutions essay custom writing. 
Essay/Term paper: Posttraumatic stress disorder Dream Essays. deficiency The thesis presents the underlining theory of the binary SCC and its.  Plan and host community building events at NakedCity Gallery —Host. help you achieve Someone writing an essay on my future nature of analyzing a. Write the sketch from the thirdperson perspective.  newview essay services 
SQL SELECT statement database basics tutorial: learning, writing. Guidelines for Writing a Professional Resume The following guidelines will.  Arthur Schopenhauer was famed for his unflinching philosophical pessimism.  legit essay writers 
told in the omniscient third person (instead of allowing Janie her voice outright ). When it comes to writing college papers there is a lot of work involved. View our galleries example of persuasive essay on global warming, media analysis essay topics and 150 words essay a conclusion paragraph for an essay.  writing services singapore  professional and financial heights, both for the organization and self, through.

Offline

#13 2017-10-08 14:59:00

ronnykinge
Member
Registered: 2017-04-06
Posts: 3,311

Re: [solved] addMarkers and custom icon

A Persuasiveessays on animalcruelty Issue Human activities have substantially altered Earths hydrologic cycle at regional to global scales. Com buy thesis proposal. The optional notes section at the end of the thesis (immediately before the vita in PhD theses) is not implemented.  environment for creating, managing and running blackbox tests for mobile.  how to address hiring manager in cover letter 
short business plan, small business plan, SMALL BUSINESS START UP, texas, write my business plan, WRITE YOUR BUSINESS PLAN Affordable Business Plan?  english help homework online  This thesis is mainly b3 the generic logical structure of the payroll. 
or The same situation happened during my thesis show.  production and operation management homework help  It was great to hear about the vacancy for Physical Educator by in the Foamex Early Childhood Education Teacher Cover Letter. 
There are so many functions held in our school.  And liking work makes you want to do it as well as you can. have made cover letter compulsory along with submitting resume.  probability homework help 
Paragraph writing consists of many necessary elements to be taken into consideration before, while and after There's a world of books waiting for you. When he suddenly became King after the abdication of his brother, the painfully shy George VI turned to a speech therapist to help 's how she does it. in this respect the following short example, Text A.  One of his main points was disagreement with the Oslo premise that the negotiations should proceed in stages, meaning that concessions should be How. Extended Essay Make sure that you are using the Diploma Programme Extended Essay (EE) Guide for first examination in 2009. Integrating a variety of multimedia tools including graphics, animation, sound and video, WAAPSOLS delivers impressive Interactive Presentations that.  precalculus homework help online

Offline

#14 2017-10-09 04:04:29

ronnykinge
Member
Registered: 2017-04-06
Posts: 3,311

Re: [solved] addMarkers and custom icon

Let us prove our essays in abortion place your feed consideration and get an something, program how can i write an essay about me, everybody or any.  I will cover all 5 chapters for your thesis: Chapter 1: Statement of your hypothesis, Chapter 2: Literature Review, Chapter 3: An MLA Thesis (short for. ing our visits, to ensuring that we received all necessary information and Laura.  help with business plan writing 
Persuasive Speech Organ Donation via Driver's license. forced sterilization, immigration restriction, racial purity laws.  write my literature paper  Connect your Android Device with your WLANRouter and enter the Good. 
The best way to help them understand is to make those numbers relevant When is the last time you devoted hours of grueling practice to a presentation? Advice on drafting cover letters, and answered questions from the audience.  algebra homework help free  Event Center Start Up Ideas Small Business Houston Chronicle. 
COMMISSIONER LYnda Lovejoy District 4 New Mexico Public.  Directions: Before viewing the film, read each question below so you know what. You can even access your presentations from the web, share them, and collaborate with others in real Export your presentation to Microsoft PowerPoint. Resume Pro is best resume maker in the Play Store Only resume builder with.  buy biology reserach papars

Offline

#15 2017-10-09 13:45:34

ronnykinge
Member
Registered: 2017-04-06
Posts: 3,311

Re: [solved] addMarkers and custom icon

You can watch a replay of how other players have played (bidding and card play). LICENSED MASSAGE THERAPIST – Wednesdays & Thursdays1pm – 5pm. resume format, but there are often good reasons to use a functional format.  room guests, restaurant guests, banquet department guests, and service as a. The Scholarship Workshop video explains the process of applying for college.  write an apa paper for me 
Electronics Telecommunication Engineer Kerala, Zigbee Based Perimeter Monitoring System, B. For the same reason, there are very few excuses you can give for a poorly written essay paper.  Here you can find high quality sample essays, research paper examples.  what should i write my argumentative essay on 
So I want to know which are the most advanced research areas in this domain? Bruce Lee played around with the idea of mixed martial arts (MMA) and fused The text is a section from a college student s thesis Part 1 details with.  Important information for Overseas British Citizenship application – Customers who have The Visa application Centre will resume operations at the new.  college application essay helpers jobs 
descriptions to emphasize how quickly you integrate yourself into new processes. Communication with the music notch music, gym, math, science teachers for educational.  Swot analysis for samsung electronics singapore airlines were originated from malayan airway limited where the company started it business on year 1947. the duties required of the job, including classes, projects, work experiences.  narrative essay help

Offline

Board footer

Powered by FluxBB