Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7972351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:50:26+00:00 2026-06-04T07:50:26+00:00

In the code below, I’ve been displaying the greyscale of the map using Google

  • 0

In the code below, I’ve been displaying the greyscale of the map using Google Maps v3 with the desired latitude and longitude from the DB. Can someone help me figure out how I can put only one marker at the desired latitude and longitude.

<script type="text/javascript"
    src="https://maps.googleapis.com/maps/api/js?sensor=false">
</script>

<script type="text/javascript">
var map;
var latitude = <?php echo $store_details->latitude; ?>; 
var longitude = <?php echo $store_details->longitude; ?>;
var brooklyn = new google.maps.LatLng(latitude, longitude);
var MY_MAPTYPE_ID = 'Greyscale';

function initialize() {
    var graystyle = [{
        featureType: "all",
        elementType: "all",
        stylers: [ { saturation: -100 }, { visibility: "on" } ]
    }];

    var mapOptions = {
        zoom: 15,
        center: brooklyn,
        mapTypeControlOptions: {
            mapTypeIds: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID]
        },
        mapTypeId: MY_MAPTYPE_ID
    };

    map = new google.maps.Map(document.getElementById("map_canvas"),
        mapOptions);

    var styledMapOptions = {
        name: "Greyscale"
    };

    var grayMapType = new google.maps.StyledMapType(graystyle, styledMapOptions);
    map.mapTypes.set(MY_MAPTYPE_ID, grayMapType);
}
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:50:27+00:00Added an answer on June 4, 2026 at 7:50 am
      var latlng = new google.maps.LatLng(latitude,longitude);
    
      var marker = new google.maps.Marker({
          position: latlng,
          map: map
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Code below has been updated and worked properly) There is dynamic OrderBy sample from
Code below from other stackoverflow answer is used in jqGrid to implement checkbox using
The code below returns none . How can I fix it? I'm using Python
The code below from http://www.scalaclass.com/book/export/html/1 to do matrix dot product. I can't understand the
Code below is used to save PostgreSql database backup from browser in Apache Mono
The code below working for only first div. I can't display other divs when
The code below removes www., etc. from the beginning of websites that are entered
Code below sets default values for new row if row is added using form.
The code below is for saving friends list from facebook. Profile[] f=user.getFriends(); for(int i=0;i<f.length;i++){
The code below contains a whole bunch of error messages, and I can't for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.