Remove "Google map" dashed border - google-maps

i am not fluent in js and Html, i am trying to fix the map on our website that shows dashed border :
And the actual map look like this (on google map) :
There is a political issue and google shows the map without border(dashed) to users inside Morocco and show the other map to the rest of the world users, we need to fix this as 90% of the target users on our website are from Morocco.
I have tried to fix it using this method :
https://daker.me/2017/08/fix-morocco-borders-on-google-maps-2017-version.html
But either the map vanish or no changes, the original map code :
http://pasted.co/46e7141b
I also tried to change the Google Map API domain from google .com to .co.ma
Please if there is any solution i would like to fix this as soon as i can, thank you in advance.

This sounds like something that you may not be able to change, but some of the styling of the map certainly can be altered. Google has a great tool here you can check out to investigate with:
https://mapstyle.withgoogle.com/
Further details can be found here:
https://developers.google.com/maps/documentation/javascript/styling

Use region=MA query parameter in your API calls, see localization docs,
and demo.

Related

Box inside google maps

I've been searching an answer to this and the best i could find was here at stackoverflow, where someone explains how to insert a box of information inside the Google Maps but actually i would like to have that box side-by-side with my location.
Here is an example, just click at one of the green dots in the map, it will show you what i would like to have:
http://www.leroymerlin.pt/Site/Lojas.aspx
How can i do this? It even zooms in automatically! Wow, Google maps API V3 seems to be pretty awesome. This is cool too: goo.gl/WDMYmz . Not related though..
Thank you very much for all the help provided.
What you see there is a custom overlay , a implementation of the OverlayView-class
There are libraries for a convenient creation of such overlays, e.g. infobox. The zoom may be set via the setZoom-method of the map.

Georeferencing of image (like Google Floor Plans)

I have a building floor plan and I need to specify its position on top of google map.
I like the way this is done in Google Floor Plans app - screenshot(the right part with map) - but I cannot figure out how they made it! :)
What part in Google Maps API I should look at?
In short - I have an image (plan of floor), and need to show it on top of Google Map and be able to manipulate with it (changing dimensions on events).
I'm thinking you'll want to implement a custom overlay. That link provides the relevant instructions for doing so. Also, Google provides a simple example so you can see the result here. Is that sort of what you're going for?
#Cianan Sims: Well, sure, I want custom overlay, but how is the question :-)
Fortunately, Google published tool called Overlay Tiler, which does exactly what I wanted - georeferencing of the image.

Use a URL to link to a Google map with a marker on it

I want to link to google maps at a particular location with a marker on a particular point.
It's easy to link to a location:
http://maps.google.com/?ll=XX.XXXX,XX.XXXX
But how do I drop a marker at that point too? preferably with a bit of my own text but that's just a bonus.
2017 - Google has released documentation on this see new accepted answer: https://stackoverflow.com/a/44477650/359135
In May 2017 Google launched the official Google Maps URLs documentation. The Google Maps URLs introduces universal cross-platform syntax that you can use in your applications.
Have a look at the following document:
https://developers.google.com/maps/documentation/urls/guide
You can use URLs in search, directions, map and street view modes.
For example, to show the marker at specified position you can use the following URL:
https://www.google.com/maps/search/?api=1&query=36.26577,-92.54324
For further details please read aforementioned documentation.
You can also file feature requests for this API in Google issue tracker.
This format works, but it doesn't seem to be an official way of doing so
http://maps.google.com/maps?q=loc:36.26577,-92.54324
Also you may want to take a look at this. They have a few answers and seem to indicate that this is the new method:
http://maps.google.com/maps?&z=10&q=36.26577+-92.54324&ll=36.26577+-92.54324
If you want to include a zoom level, you can use this format:
https://www.google.com/maps/place/40.7028722+-73.9868281/#40.7028722,-73.9868281,15z
will redirect to this link (per 2017.09.21)
https://www.google.com/maps/place/40%C2%B042'10.3%22N+73%C2%B059'12.6%22W/#40.7028722,-73.9868281,15z/data=!4m5!3m4!1s0x0:0x0!8m2!3d40.7028722!4d-73.9868281
This URL format worked like a charm:
http://maps.google.com/maps?&z={INSERT_MAP_ZOOM}&mrt={INSERT_TYPE_OF_SEARCH}&t={INSERT_MAP_TYPE}&q={INSERT_MAP_LAT_COORDINATES}+{INSERT_MAP_LONG_COORDINATES}
Example for Mount Everest:
http://maps.google.com/maps?&z=15&mrt=yp&t=k&q=27.9879012+86.9253141
Full reference here:
https://moz.com/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters
-- EDIT --
Apparently the zoom parameter stopped working, here's the updated format.
Format
https://www.google.com/maps/#?api=1&map_action=map&basemap=satellite&center={LAT},{LONG}&zoom={ZOOM}
Example
https://www.google.com/maps/#?api=1&map_action=map&basemap=satellite&center=27.9879012,86.9253141&zoom=14
If working with Basic4Android and looking for an easy fix to the problem, try this it works both Google maps and Openstreet even though OSM creates a bit of a messy result and thanx to [yndolok] for the google marker
GooglemLoc="https://www.google.com/maps/place/"&[Latitude]&"+"&[Longitude]&"/#"&[Latitude]&","&[Longitude]&",15z"
GooglemRute="https://www.google.co.ls/maps/dir/"&[FrmLatt]&","&[FrmLong]&"/"&[ToLatt]&","&[FrmLong]&"/#"&[ScreenX]&","&[ScreenY]&",14z/data=!3m1!4b1!4m2!4m1!3e0?hl=en" 'route ?hl=en
OpenStreetLoc="https://www.openstreetmap.org/#map=16/"&[Latitude]&"/"&[Longitude]&"&layers=N"
OpenStreetRute="https://www.openstreetmap.org/directions?engine=osrm_car&route="&[FrmLatt]&"%2C"&[FrmLong]&"%3B"&[ToLatt]&"%2C"&[ToLong]&"#Map=15/"&[ScreenX]&"/"&[Screeny]&"&layers=N"
2023 update:
I found a very easy way to implement this function.
From google maps, find your POI (point of interest) and click on it.
on left handside opening menu you will see an icon Share and click.
A modal opens and you see a sharing link input box. Next to it you will see Copy link. Go to your url and paste it like;
Drive to our office
Voila, you are done.

How do I remove 'Earth' button from Google Maps?

I'm using the Google Maps generator to create a few maps for a client. The maps embeded on the site are a bit small (255x176), so map real state is crucial. I've already removed the balloon, but can't find a way to remove the "Earth" view button from it (all newly generated maps come with it now, 4 views in total).
The annoying part is that the "Earth" view requires a Google Earth plugin to be used anyway, something the client could live without - me too.
Any advices there? Feedback will be greatly appreciated!
Cheers,
Wallace
You may customize the map controls using the MAPS API.
Visit http://code.google.com/apis/maps/documentation/javascript/controls.html#DefaultUI
Look for MapTypeControlOptions and pass appropriate map type you want to show.
Refer http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeControlOptions
http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeId
If using the default UI, you would get only the map types in G_DEFAULT_MAP_TYPES, which does not include the Earth map type (G_SATELLITE_3D_MAP).
This means your generator is adding this map type explicitly. So you should be able to simply look for G_SATELLITE_3D_MAP in the javascript you get from the generator, and remove references to it.
If you are still having troubles, can you provide a link to the map generator you are using?

Do i need use google maps api only to embed litle map with route calculator/display for only one destination?

Well i want to upgrade contact page with dynamic map showing location and give oportunity to calculate route for comapny headquatters. Id it necessery for such simple task use Google api? i mean here generating akey etc? Fo i have any other alternatives to google maps?
There's really no reason to mess with the API at all unless you need to customize the appearance or behavior of gmaps. Why not just use an iframe with a url of:
http://maps.google.com/?q=[you-url-encoded-address-here]
or better yet, set up a textbox and a 'get directions' button to redirect that frame to:
http://maps.google.com/maps?saddr=[their-address]&daddr=[your-address]
edit: this works well in modal dialog if you don't want the google logo sticking out like a sore thumb in your pageflow
You could probably embed directly with a specific URL that will configure it to have the destination you want.
By the way, well written answers are much more likely to receive useful responses here.
You could consider http://www.openlayers.org/ as an alternative to google maps.
In fact open layers can be used to add a Google map, or an OpenStreetMap map or a Bing map, etc.