CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

How to use the Styles ?

by c.schwoerer » 30 Jan 2018 09:49

Hi all,
I need some help how I can use use the map styles.

I need custom colors on the google map.
In the Google API I can use the styles in map options. like this:

Code: Select all
  // Nightview Style!

  'var myOptions = {'+
  '    zoom: '+IntToStr(Geo.InitialMapZoom)+','+
  '    center: latlng,'+
  '    mapTypeId: google.maps.MapTypeId.ROADMAP,'+


  '    styles: ['+
            '{elementType: "geometry", stylers: [{color: "#101010"}]},'+
            '{elementType: "labels.text.stroke", stylers: [{color: "#242f3e"}]},'+
            '{elementType: "labels.text.fill", stylers: [{color: "#746855"}]},'+
            '{featureType: "administrative.locality",elementType: "labels.text.fill",stylers: [{color: "#d59563"}]},'+
            '{featureType: "poi",elementType: "labels.text.fill",stylers: [{color: "#d59563"}]},'+
            '{featureType: "poi.park",elementType: "geometry",stylers: [{color: "#263c3f"}]},'+
            '{featureType: "poi.park",elementType: "labels.text.fill",stylers: [{color: "#6b9a76"}]},'+
            '{featureType: "road",elementType: "geometry",stylers: [{color: "#38414e"}]},'+
            '{featureType: "road",elementType: "geometry.stroke",stylers: [{color: "#212a37"}]},'+
            '{featureType: "road",elementType: "labels.text.fill",stylers: [{color: "#9ca5b3"}]},'+
            '{featureType: "road.highway",elementType: "geometry",stylers: [{color: "#746855"}]},'+
            '{featureType: "road.highway",elementType: "geometry.stroke",stylers: [{color: "#1f2835"}]},'+
            '{featureType: "road.highway",elementType: "labels.text.fill",stylers: [{color: "#f3d19c"}]},'+
            '{featureType: "transit",elementType: "geometry",stylers: [{color: "#2f3948"}]},'+
            '{featureType: "transit.station",elementType: "labels.text.fill",stylers: [{color: "#d59563"}]},'+
            '{featureType: "water",elementType: "geometry",stylers: [{color: "#000000"}]},'+
            '{featureType: "water",elementType: "labels.text.fill",stylers: [{color: "#515c6d"}]},'+
            '{featureType: "water",elementType: "labels.text.stroke",stylers: [{color: "#17263c"}]}'+
            ']'+
  '    };'+

  // Create the map...
  '  map = new google.maps.Map(document.getElementById("'+Geo.HTMLElementId+'"),myOptions);'+



This work fine.

I even tried this with the "map" object without success:

Code: Select all
           
with IWCGJQGMap3.JQGMapV3Options do
  begin
       
    Map.Options.Styles.Add('{elementType: "geometry", stylers: [{color: "#101010"}]}');
    Map.Options.Styles.Add('{elementType: "labels.text.stroke", stylers: [{color: "#242f3e"}]}');
.....

How is the right way?

Thanks your your help?
c.schwoerer
 
Posts: 18
Joined: 25 Jan 2018 11:09

by Alexander Bulei » 31 Jan 2018 11:01

Hello,

Please check the attached demo..

Best Regards.
You do not have the required permissions to view the files attached to this post.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by c.schwoerer » 01 Feb 2018 09:14

Thank you ;)
Great Job!
c.schwoerer
 
Posts: 18
Joined: 25 Jan 2018 11:09

by Alexander Bulei » 01 Feb 2018 11:23

Hi c.schwoerer ,

Thank you ;)
Great Job!


;)

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQGMap3

Who is online

Users browsing this forum: No registered users and 4 guests

Contact Us.