Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 48

Thread: Assigning entered times to marks that are colour coded for time frame

  1. #11
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,372
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    I've been working in another direction a bit. I became fascinated by the idea of outlining and shading the counties. I found a UK data service that has the 2011 county borders available in KML (among many other formats/types of data on the counties, not all formats have as much positioning/border info as KML, and it's easiest for me to read):

    https://census.edina.ac.uk/easy_down...ngland_ct_2011

    And I worked out a way to use that data in Google Maps Polygons:

    https://developers.google.com/maps/d...hapes#polygons

    The resulting file is much too large (owing to the extremely long lines of coordinates required to draw such complex shapes). But you may view the result here:

    http://jscheuer1.com/mapdemos/polydemo/

    You can use your browser's 'view source' to copy the code. I got a free api key so that my live demo would be legit. It's domain specific though, so either remove it or replace it with your own. I commented the code to hopefully make it clear, much should be fairly obvious, any questions, just ask.

    You should see 5 counties shaded in and if you click on one it will pop up its name. If you uncheck/click on one of them in the checkboxes, that one will go away. Checking/clicking again it will make it return. The demo I worked from uses a slightly different method of initializing the map api, and I prefer it. I'm going to try integrating into it some of the other features soon (particularly the two address one reference marker generator form). I still don't really get what you mean by time or color (well everyone knows what time and color are), more specifically how the user is supposed to experience these on the map/page. Perhaps after I go back over your post a little it may help. Anything more specific you can tell me about those will probably help even more. What do you envision the user experience of time and color to be on your map?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. #12
    Join Date
    Feb 2016
    Posts
    49
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Thank you, and I am pleased I have given you a new interest
    I have mad my own KML files for each county as I made a complete one but it was too big in size. I think what you have done in the demo is great and I will certainly look at putting that code in to my work as needed. I was woundering now how I can encorperate these files I have made or what you have done, to make it work in my doing for the drop down menu?
    Also how did you segregate the cordinates for each countie from the KML file, as in mine there are hundreds, as instead of using a KML file could put the in a seperate Javascript file and link it into the coding for the county border lines.

    I am building this in stages, so there will be more data/information input to come than just the reference numbers, but trying to take a step at a time for learning perpuses, the general idea for the color will be to place a marker via the location search enter certain amounts of information that can the be shown with that marker. Once the information entered is confirmed to be correct then it can be asigned to the marker and by doing this change the colour of the marker. This will then show to anyother user that that Marker has been assigned the correct information for that location, and a time elapse and date for that assigned information would show too.
    Last edited by kwood30; 03-11-2016 at 10:22 PM.

  3. #13
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,372
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    What I'm doing is in stages also, breaking new ground, then going back and incorporating earlier things. I'm already at work at the latter. For one thing, I liked the layout you had at first (HTML + css). It seems to be more mobile friendly, while still being accessible to larger screens. What I did with the counties can work on mobiles, but it requires the user to really know how to manipulate their display before they can get a decent view of what the page is about. Your layout was immediately recognizable to mobiles and only perhaps a little smallish for larger screens, the users of which can simply magnify if they want.

    These KML files are interesting and I've already thought it might be possible to read them on the fly for data. The obvious problem though is size. Like if you read in the entire UK counties borders file just to define 1 or 6 counties, you're wasting a lot of time/memory/bandwidth. As I think you have noticed, I've opted for simply cutting out of the master UK counties KML file the coordinates needed for the counties I want, and pasting them into the page that uses them. They could also be in a separate file, especially good if they are to be used by 2 or more pages. I turned them into javascript strings (they were already xml strings anyway) and then ran a function on each one to convert them into Google maps polygon paths arrays. This conversion would be needed no matter where/how the data was stored, unless it was already an array of objects, which - because of formatting requirements would be an even larger file, so just not worth it. It's tempting though to just load up the whole UK counties KML file and use it on an as needed basis to outline any county in the UK. I haven't tried that yet, I suspect it would be a disaster. So I think I'll try other things first.

    In a day or so I will have another demo, incorporating some of the earlier things like markers into the outlined counties page I currently have under the previous or similar more mobile friendly layout.

    But, and forgive me for repeating myself. I'm still having a hard time understanding what you specifically mean/want from time and color. Have I fulfilled the color requirement with the different colored counties? Or is there more to do with color that you want? And, again, as for time. It seems pretty simple to involve time and/or elapsed time with info in a marker's popup. But I'm still not clear on exactly what you want it to show/tell about time in relation to that marker (or something else?)? Are time and color supposed to be connected in some way or not? Anything more you could say on color and/or time might help me make what you want happen.

    OK, here's the latest demo (I've moved the coordinates for the counties to an external javascript file as - now they're being used by two pages). This one has elapsed time for markers and many of the other marker features I think you liked from previous demos:

    http://jscheuer1.com/mapdemos/polyplusmarkersandtime/

    Again, for me to fine tune the code for you, I need to have a better understanding of what you envision it being like to use the page. I know I keep saying that, but that's how I can understand what you want better.
    Last edited by jscheuer1; 03-12-2016 at 05:24 AM. Reason: add link to latest demo
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #14
    Join Date
    Feb 2016
    Posts
    49
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Right, what I have done is created an explination PNG file which will hopefully explain and make more sense to you regarding the colored marker.

    Click image for larger version. 

Name:	2016-03-12.jpg 
Views:	60 
Size:	20.2 KB 
ID:	5853

    I think you have done great with these county polygons. What you have done is slightly different to my general end result but looks great and helps me with my progression in learning. I am trying to create this myself to show you that I am learning lol, But my general plan I to have a permenate fixed overlay on the google map of the county border lines for the UK and the selection menu I have created for the 5 counties is for the perpose of focusing on that particular county once selected.

  5. #15
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,372
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    One thing I don't like about that picture is having anything to the left of the map. The reason for that is because on mobile devices with small screens, that won't fit. So, ideally everything besides the map should be to the right of it. And I've stuck to that in my latest effort here to otherwise attempt to get as close as possible to what I think you're looking for:

    http://jscheuer1.com/mapdemos/polypl...meandactivate/

    That said, if you want to abandon support for mobile/small screen, we can fit a lot more on the page, and have a larger map - like with my first live demo.

    Anyways, what I've added is:

    • Brought back the supplement window so as to see a duplicate of the mouseover infowindow content. I don't get why this is desirable, but you seem to like it.
    • Moved the button controls and marker selection drop down to the right and up to make room for the supplement window.
    • Added an "Activate Marker" Button to the button controls and marker selection drop down element. If this is clicked when a marker is selected, it will change that marker's icon to green. A marker may be selected from the drop down list of markers by clicking on its listing there, or by clicking on it in the map.


    I'm thinking this should give you everything you need at this point, at least as a sort of template. But, of course, if you have any questions, feel free to ask.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #16
    Join Date
    Feb 2016
    Posts
    49
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    This is looking great and getting there thank you, I really appreciate it and I think your a fantastic tutor for me, and I hope you don't mind me saying that.
    Are we able cange the county selection from colours to focusing on that particular county and inbed one KML file that I have created (I would add the file for you, but I don't know how to insert a file) to show all the county border lines of the UK? With regard to selecting the county I prefer the drop down menue I created. with postioning the stuff, It is generally designed for use on a computer, but good idea regarding mobile use, but I can change all that through the CSS.
    With regard to the asigning the colour to the marker is nearly at what I want, but i want that 'activate marker' button in the supplement window that opens on the mouse over. The idea for this is for if your creating a job loaction for someone to work at, when entering then info to that location checking with the supplement window and assinging the marker to change colour with that info with tell the person that that job is creat to do. This is away to explain why I want it does that make more sense with that explaination?
    What you have the time etc is perfect thank you, just would like that shadowed in the supplement windo too. Also is there away of assign the date the marker was assigned too along with the time?
    Again I really appreciate your help, I am also trying to do this myself but not getting far, I am nowhere near as talenting and expert at this as you are, and again I really appreciate your help and support.

  7. #17
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,372
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    I'll give a more detailed response to some of this later. But for now I was just messing around with KML. Unless you want to use a server side language to include or otherwise parse for use the data in KML, the only really useful approach in my opinion would be to fetch it via AJAX as an xml document. It has to be a valid xml document for that to work, but a valid KML documant is also a valid xml document. You could load it in an iframe or object tag and try to access it that way, but this is the sort of thing AJAX was made for, so I lean that way. Here's what I did so far, using jQuery 1.11.1 - I made a request to the 81,173K england_ct_2011.kml file I had downloaded earlier (the downloaded one on my computer, not the one on the UK data service's servers, this should be similar to an AJAX request to file on one's own server, but more efficient), fully expecting that to crash the browser. It took less than a minute, so with a much smaller KML file, it should be faster or similar even if on your remote host. Here's how I made the request:

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script type="text/javascript">
    var thexml;
    jQuery(function($){
    	$.ajax({
    		url: 'england_ct_2011.kml',
    		dataType: 'xml',
    		success: function(response){
    			thexml = response;
    			console.log('ready');
    		}
    	});
    });
    </script>
    After this was completed the thexml global variable contained the xml nodes of the KML file, and I was able to do this (in the console, but it could be done on the page once the KLM document is read in):

    Code:
    $('name:contains("Luton")', $(thexml)).parent().find('outerBoundaryIs').text();
    That (took a little time because it's a huge amount of data) gave the KML formatted coordinates for Luton county. I picked a shorter one, but it also worked for Bedford. Only issue with Bedford is it matched 2 records (Bedford and Central Bedfordshire).

    Anyways, if I was doing this on the page, I would have set a variable to that, like:

    Code:
    var LutonCodes = $('name:contains("Luton")', $(thexml)).parent().find('outerBoundaryIs').text();
    And then I would be able to later convert them to a Google Maps style paths array of latlng objects.

    The main issue here in my opinion is time. But there's another. If you make a slight typo or other digression from strict KML/xml format, your document will be unusable in this and probably any manner other than simply opening it manually and looking at it in an editor. You might be able to parse it server side or with javascript as plain text. But too much inconsistency will make even that fail at least for some things. Also of note here is that if your records are stored differently than in the file I was working with, different tags will need to be queried in perhaps different ways in order to get the information.

    All that can be worked out except time. If this is all local it probably will be OK-ish. But there was significant lag, not only in loading the file into memory, but also in reading out the coordinates. Using my method (placing these values as variables in an external javascript file), was considerably faster. Having a smaller dedicated KML file would speed up loading, but probably not the fetching of the coordinates from memory. Even loading would probably take some time if the page was live.

    That said, unless you have a server side language like PHP, well in my case PHP, I don't think I want to try this in asp because I have no way to test that. So - say with, PHP it might be faster if that's available. I think it would be (speed - wise) more like copying and reading files right on the server.

    When I first looked this up using Google, the method used was to create it as a javascript file as I have been doing so far.

    Finally for now, if you want me to look at your KML file, you will probably need to make it into a zip archive and then attach it to a message here using the advanced editor (choose Go Advanced from near the bottom right while posting here then use the controls at the top of the advanced editor to find the attach icon - looks like a piece of paper with a paper clip on it, to attach the file). Hopefully it won't be too big. Or if you have live web space somewhere, just put it there and give me the address to it in a post.

    However, if you don't want to outline or shade a county but only want to bring it into view at the center of and filling most of the map. all you need are 4 latlng pairs. One pair each for its Northernmost, Easternmost, Southernmost, and Westernmost points. Once you have those, you could make markers with transparent pins for all four of them, then make a new boundary object, then fit the map to those bounds. A KML file with only that much information would load pretty fast. It would still be faster and easier with a javascript file.
    Last edited by jscheuer1; 03-13-2016 at 10:18 PM. Reason: add last paragraph
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #18
    Join Date
    Feb 2016
    Posts
    49
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Some of what you have said has gone straight over my heard lol but I will re-read untill i get it, as alot of what your are saying is new to me. I have only just taught my sself about these KML files in the last few days.
    I agree, I would prefere to have it all in a javascript format, as would be so much easier, but the way all the co-ordinates are set out, like you said, am not sure if it would work and need lots of checking for issues. The KML file that I have created is only just over 3mb, so i will upload that later, as I am still messing aroud with my code, and am hoping to show it to you for your opionions.
    I think the idea regarding the 4 latlng is a good idea as i only really want the county to be selected for the map then to show that whole county, the KML file is only for the overlay of all the county borders.
    Again thank you so much. I will post some more bits later, but also looking forward to what else you may have come up with

  9. #19
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,372
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    Right, if you want a shaded overlay and/or an outline of a county, you need a long list of coordinates to form the boundary. But if you just want to focus the map on the county with no highlighting, you only need 4 sets of latlng coordinates. These should be as close to the north, east, south, and west edges as possible, but don't even have to be perfect. There are pages on the web where you can get these by clicking on a map in the approximate locations. You can even add a custom or the generic marker (with an infowindow, if desired) at the center of the county (a 5th set of latlng coordinates).

    I was just testing this out. You might as well just have the center of the county because fitting to the bounds will not necessarily get you the optimal zoom, I had thought it would. It will make sure all of the county is visible, but might leave a lot of other territory around the edges. So one would have to set the zoom. That would depend to a degree on the dimensions of the map div, so would be custom. But you can set a custom zoom on a center latlng pair as easily as on 4 bounding ones.

    Again these are options only when you want no shading or border.
    Last edited by jscheuer1; 03-14-2016 at 04:49 PM. Reason: tested
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #20
    Join Date
    Feb 2016
    Posts
    49
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    I think that sounds the best way of doing it. I really like what you have done with colours of the county ect so am using that too, but mainly want to work on what I have been asking/talking about from the start. I have got a more understanding of what you said yesterday and have been having ago but have not been successful in getting it to work properly.
    I would like to go for your recomendations of the 4 or 5 coordinates for each county as it doesn't matter regarding parts of the other counties aslong as it shows the whole county selected.

    Here are the two set of coding i have been messing around with but cannot get them to fully work. As you can see the first one is what you have done, and I have just messed around the CSS side and tried to input the KML file without success (KML is at this link https://app.box.com/s/phnxv2n1cm3o7nssqnptj2sx1u6mnkkl). If you could advise where I have gone wrong I would appreciate it for both this and the next one.
    Code:
    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <title>County Polygons + Markers w/elapsed time</title>
        <script src="../fiveenglishcounties.js" charset="UTF-8">
    // positioning codes  Copyright 2012 UK Data Service. All rights reserved Creative Commons License https://www.ukdataservice.ac.uk
    </script>
    <script type="text/javascript">
    var map, bounds, geocoder, markers = [], pollies, pinImage, pinColor = '00FF00', defaultPinColor = 'F75850', defaultPin;
    $('#controls input[name="[counties]"]').click(function(){
    	var poly = pollies[this.value];
    	if(poly.map){
    		poly.infowindow.close();
    		poly.setMap(null);
    		this.checked = false;
    	} else {
    		poly.setMap(map);
    		this.checked = true;
    	}
    });
    var ctaLayer = new google.maps.KmlLayer({
        url: 'file:///C|/wamp/www/maps/UK County border lines.kml',
        map: map
      });
    }
    function elapsed(rfd) {
    	var rs = (new Date().getTime() - rfd.getTime()) / 1000,
    	days = Math.floor(rs / 86400),
    	hours = Math.floor((rs - (days * 86400 )) / 3600),
    	minutes = Math.floor((rs - (days * 86400 ) - (hours * 3600 )) / 60),
    	secs = Math.floor((rs - (days * 86400 ) - (hours * 3600 ) - (minutes * 60))),
    	fet = secs + 's';
    	if(minutes){fet = minutes + 'm' + ' ' + fet;}
    	if(hours){fet = hours + 'h' + ' ' + fet;}
    	if(days){fet = days + ' Day' + (days > 1? 's' : '') + ' ' + fet;}
    	return 'Created: ' + rfd.toLocaleTimeString().toLowerCase() + ',<br>' + fet + ' ago';
    }
    function createMarker(latlng, html, map) {
    	var ref = $.trim($('#reference').val()),
    	infowindow = new google.maps.InfoWindow({
    		content: ref || html
    	}),
    	marker = new google.maps.Marker({
    		map: map,
    		time : new Date(),
    		position: latlng,
    		html: html,
    		icon: defaultPin,
     		infowindow: infowindow
    	}),
    	$tm = $('#themarkers').append('<option value="' + html + '" title="' + infowindow.content + '">' + html + '</option>');
    	$tm.get(0).selectedIndex = 0;
    	marker.addListener('mouseover', function() {
    		clearInterval(infowindow.timer);
    		infowindow.setContent((ref || html) + '<br>' + elapsed(marker.time));
    		$('#supplementwindow').html(infowindow.content).fadeIn();
    		infowindow.timer = setInterval(function(){
    			infowindow.setContent((ref || html) + '<br>' + elapsed(marker.time));
    			$('#supplementwindow').html(infowindow.content);
    		}, 300);
    		infowindow.open(map, this);
    	});
    	marker.addListener('mouseout', function() {
    		clearInterval(infowindow.timer);
    		infowindow.close();
    		$('#supplementwindow').fadeOut();
    	});
    	marker.addListener('click', function() {
    		var oe = this.optel;
    		$tm.get(0).selectedIndex = $('option', $tm).index(oe);
    		$tm.trigger('change');
    	});
    	marker.optel = $('option', $tm).last();
    	$tm.get(0).size = $('option', $tm).length;
    	markers.push(marker);
    }
    $('#formcont form').submit(function(e){
    	var addresses = $('.address', this);
    	addresses = [addresses.eq(0).val(), addresses.eq(1).val()];
    	addresses.forEach(function(address, refnum) {
    		if (address) {
    			geocoder.geocode({
    				'address': address
    			}, function(results, status) {
    				if (status == google.maps.GeocoderStatus.OK) {
    					map.setCenter(results[0].geometry.location);
    					createMarker(results[0].geometry.location, address, map, refnum);
    					bounds.extend(results[0].geometry.location);
    					map.fitBounds(bounds);
    				} else {
    					alert("Geocode was not successful for the following reason: " + status);
    				}
    			});
    		}
    	});
    	e.preventDefault();
    });
    $('#activatemarker').click(function(){
    	var tm = $('#themarkers'), si = tm.get(0).options.selectedIndex, $o = $('option', tm).eq(si), i = $o.val();
    	if(!i){return;}
    	$.each(markers, function(idx, v){
    		if(v.html === i){
    			v.setIcon(pinImage);
    			return false;
    		}
    	});
    });
    $('#removemarker').click(function(){
    	var tm = $('#themarkers'), si = tm.get(0).options.selectedIndex, $o = $('option', tm).eq(si), i = $o.val();
    	if(!i){return;}
    	$.each(markers, function(idx, v){
    		if(v.html === i){
    			v.setMap(null);
    			markers.splice(idx, 1);
    			return false;
    		}
    	});
    	$o.remove();
    	bounds = new google.maps.LatLngBounds();
    	if(markers.length){
    		$.each(markers, function(i, v){
    			bounds.extend(v.position);
    		});
    		map.fitBounds(bounds);
    	}
    	if(markers.length < 2){
    		map.setZoom(markers.length? 13 : 8);
    	}
    	tm.get(0).size = $('option', tm).length;
    });
    $('#themarkers').change(function(){
    	this.title = this.options[this.options.selectedIndex].title;
    	var i = this.value;
    	if(!i){return;}
    	$.each(markers, function(idx, v){
    		if(v.html === i){
    			map.setCenter(v.position);
    			map.setZoom(10);
    			return false;
    		}
    	});
    	this.size = $('option', $(this)).length;
    });
    $('#showall').click(function(){
    	$('#themarkers').get(0).selectedIndex = 0;
    	if(!markers.length){
    		map.setCenter(new google.maps.LatLng(52.178227, -0.46013));
    		map.setZoom(8);
    		return;
    	}
    	map.fitBounds(bounds);
    	if(markers.length === 1){
    		map.setZoom(8);
    	}
    });
    function formatCodes(codeString){
    	var a = codeString.split(' '), l = a.length, po;
    	while(--l > -1){
    		po = a[l].split(',');
    		a[l] = {lat: +po[1], lng: +po[0]};
    	}
    	return a;
    }
          function initMap() {
            pinImage = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + pinColor);
            defaultPin = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + defaultPinColor);
            var p;
    	geocoder = new google.maps.Geocoder();
    	bounds = new google.maps.LatLngBounds();
            map = new google.maps.Map(document.getElementById('map'), {
              zoom: 8,
              center: {lat: 52.178227, lng: -0.4013},
              mapTypeId: google.maps.MapTypeId.ROADMAP
            });
          pollies = {
            Bedfordshire: {
              paths: BedfordshireCodes,
              strokeColor: '#FF0000',
              strokeOpacity: 0.8,
              strokeWeight: 2,
              fillColor: '#FF0000',
              fillOpacity: 0.15,
              latlng: {lat: 52.002974, lng: -0.465139} 
            },
            Bedford: {
              paths: BedfordCodes,
              strokeColor: '#FFC0CB',
              strokeOpacity: 0.8,
              strokeWeight: 2,
              fillColor: '#FFC0CB',
              fillOpacity: 0.15,
              latlng: {lat: 52.135973, lng: -0.466655}
            },
            Hertfordshire: {
              paths: HertfordshireCodes,
              strokeColor: '#FFFF55',
              strokeOpacity: 0.9,
              strokeWeight: 2,
              fillColor: '#FFFF55',
              fillOpacity: 0.25,
              latlng: {lat: 51.809782, lng: -0.237674}
            },
            Cambridgeshire: {
              paths: CambridgeshireCodes,
              strokeColor: '#00FF00',
              strokeOpacity: 0.8,
              strokeWeight: 2,
              fillColor: '#00FF00',
              fillOpacity: 0.15,
              latlng: {lat: 52.305297, lng: 0.021820}
            },
            Northamptonshire: {
              paths: NorthamptonshireCodes,
              strokeColor: '#0000FF',
              strokeOpacity: 0.8,
              strokeWeight: 2,
              fillColor: '#0000FF',
              fillOpacity: 0.15,
              latlng: {lat: 52.272994, lng: -0.875552}
            }
          };
    	for(p in pollies){
    		var polly = pollies[p];
    		polly.paths = formatCodes(polly.paths); 
    		polly = pollies[p] = new google.maps.Polygon(polly);
    		polly.infowindow = new google.maps.InfoWindow({
    			content: p,
    			position: polly.latlng
    		});
    		polly.addListener('click', function(){
    			if(this.infowindow.map){
    				this.infowindow.close();
    			} else {
    				this.infowindow.open(map, this);
    			}
    		});
    		polly.setMap(map);
    	}
          }
        </script>
        <script async defer
        src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAV5Sf0iPzrTwgXzOnH1aRYdmqSxm5SCno&callback=initMap">
        </script>
      </head>
    Second half of this piece is on next post as couldn't fit everything on one post due to character limitations, sorry.
    Last edited by kwood30; 03-14-2016 at 09:05 PM. Reason: To explain why first page of coding is split in two.

Similar Threads

  1. Enlarge a pop-up window that is hard coded in the template
    By GreenGiant in forum Looking for such a script or service
    Replies: 10
    Last Post: 06-26-2012, 03:56 AM
  2. Replies: 2
    Last Post: 07-19-2010, 01:44 AM
  3. Replies: 14
    Last Post: 03-10-2009, 07:36 AM
  4. Replies: 2
    Last Post: 05-20-2007, 02:29 PM
  5. Replies: 6
    Last Post: 02-07-2007, 07:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •