Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem showing icons in html using CSS

 
Rancher
Posts: 5012
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on a project to change the placemarkers I use on my Google Maps html pages. For example:
http://normsstuff.x10host.com/Trips/CircumNav_Animated.html
http://normsstuff.x10host.com/Trips/2017_Asia_PlacemarkersWithLinks_InclTable.html

I would like more choices for the shape of the markers than the red circle with the tail.  

I get emails from Google about their new Maps interfaces.  So I finally took a look and found this page:
https://developers.google.com/maps/documentation/javascript/advanced-markers/html-markers
It shows three types of markers and has sosme of the code for the html page displays.  I was able to get two of the code sections to work (first and third) and am having problems with the second one.  It took some searching to get the CSS files that are needed in my modified code.  I have left in some of the HTML statements I tried as comments.  


You need a google maps key for this code to work

The problem is that the markers show as white circles, not as homes or whatever.
<JPG IMAGE>

What needs to be changed to see the same icons as are shown on the google maps page?
WhiteMarkersFor1.jpg
Shows markers as white
Shows markers as white
 
Saloon Keeper
Posts: 28054
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at this page. https://developers.google.com/maps/documentation/javascript/markers

The "icon" property allows you to use an image loaded from a URL.
 
Norm Radder
Rancher
Posts: 5012
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the link.  Yes that is yet another (and better) way to show a marker.
Still would like to know why the other does not work.
 
Norm Radder
Rancher
Posts: 5012
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question:  How do you debug CSS and javascript to find errors and/or correct behavior?
 
Tim Holloway
Saloon Keeper
Posts: 28054
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Norm Radder wrote:Question:  How do you debug CSS and javascript to find errors and/or correct behavior?



In Firefox, the F12 key opens up its diagnostic console. You can use its network tab to make sure that all of the secondary URLs (css, javascript files, images) are being fetched. Obviously, if parts are missing, the client cannot do its job properly!

Once that's done, you can confirm what CSS options are in effect for page elements using the Inspect CSS option. You can also edit the CSS (including adding/removing style elements) to tweak appearance, then use what you've learned to make permanent changes to your application source.

JavaScript is supported via an interactive debugger. You can set breakpoints, single-step, the usual stuff. The only caveat is that if you're using a complex third-party JS library, the stock distro form basically compacts it all into a single very long ugly line. Most such libraries have an alternate URL that returns the script in unpacked form as well so that you'll have discrete lines to select for breakpoints (not to mention readability!)
 
Norm Radder
Rancher
Posts: 5012
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again.
I just found out that the HTML/js/css I am testing does NOT work in Firefox.  It does work in Chrome, Edge and Opera.
 
reply
    Bookmark Topic Watch Topic
  • New Topic