Google Maps - visitor generated marker - google-maps

I found a WP extension for adding a Google Maps plugin which supports visitor-generated markers.
http://www.wpgmaps.com/visitor-generated-markers-add-on/
Does anyone know how this is done using GoogleMaps JavaScript API v3?
Thanks already!
Best regards

If you look at their demo map, it's using Google Maps API to add their markers. See their JS at http://www.wpgmaps.com/wp-content/plugins/wp-google-maps-pro/js/core.js?ver=5.34p
And you can see they're loading the markers data from an XML file, e.g. at http://www.wpgmaps.com/wp-content/uploads/wp-google-maps/6markers.xml?u=9690
So when you submit their form to add a marker, it's saving it server-side into that XML file. This will be WPGmaps' own server-side code for doing that. And it's their own javascript that loads in that XML file, loops over it and calls the Google Maps functions for adding markers and infowindows.

Related

Creating Polygon using Google Map API

I am referring the URL : https://housing.com/in/buy/search?f=eyJiYXNlIjpbeyJ0eXBlIjoiUE9MWSIsInV1aWQiOiJmMGZhNTIwNjI0ZjNhOGRlOWY4NSIsImxhYmVsIjoiUGltcGxlIFNhdWRhZ2FyIn1dLCJ2IjoyLCJzIjoiZCJ9
I am trying to make something similar, can anybody suggest how can I achieve it. I tried to search and explore google map APIs, but could not understand which API in particular can be used.
Try to read the Google Maps Showcase. Millions of apps and sites are using Google Maps APIs. Browse the showcase to see some of our favorite implementations.
You can use the MarkerClusterer library in combination with the Google Maps JavaScript API to combine markers of close proximity into clusters, and simplify the display of markers on the map.
Here's a sample project for MarkerCluster: https://github.com/googlemaps/v3-utility-library/tree/master/markerclusterer
Polygon is one feature of Drawing tools of Google Maps. The DrawingManager class provides a graphical interface for users to draw polygons, rectangles, polylines, circles, and markers on the map.
The Drawing Tools are a self-contained library, separate from the main Maps API JavaScript code. To use the functionality contained within this library, you must first load it using the libraries parameter in the Maps API bootstrap URL:
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=drawing">
</script>
Once you’ve added the libraries parameter, you can create a DrawingManager object as follows:
var drawingManager = new google.maps.drawing.DrawingManager();
drawingManager.setMap(map);
Reference: https://developers.google.com/maps/documentation/javascript/examples/drawing-tools

Custom Google Map (with markers) + Custom .json embed to website

Been trying to get my head around this for some time although clearly i'm missing something
what i am trying to do is not draw a new map although provide a src link to say (https://www.google.com/maps/d/u/0/embed?mid=1xI_dALvs0A-oySG-dkf4BYeDyBk) to something of the below
https://developers.google.com/maps/documentation/javascript/styling
I want to embed my custom map with the markers to my site and styling it
I guess map = new google.maps.Map(document.getElementById('map') has something to do with the drawing of the new map although not too sure as to take it out or what.
is there anyway to use the custom map + .json code rather than hard coding an array of poi's as would like to rely on it pointing through to the custom map link for the markers
is there any better way to get around this
Google Maps JavaScript API can load data that were stored in GeoJSON format. So you have to look into GeoJSON specification and create corresponding file for your markers (or polylines, polygons, etc.).
The Google Maps JavaScript API documentation explains how to load the GeoJSON data via Data layer of maps:
https://developers.google.com/maps/documentation/javascript/datalayer#load_geojson
You should combine the styling example with GeoJSON example from the documentation to achieve your goal.
Here is the github link - https://github.com/hpi1hpi/custom-google-map-with-json
Add google map with custom color and data from JSON with slider

How to create link to google map with opened info and window

I need to create link on google maps with marker + infowindow
I found this link:
url http://www.google.com/maps?q=41.0082,28.9784(INFO_WINDOW)
used to work before. But now it doesn't work anymore.
That is the "old"/"classic" Google Maps, it no longer works.
Some options:
Look at the embed API
Create a Google Maps Javascript API v3 map of your own that supports that functionality (example)

Annotate Google Map

i am placing some locations on google map. i need to set text next to marker on the map. is there a way to do it ? because i can not see any tools or option provided by google maps to do.
its not an application i am developing or coding. i am just saving locations on google map site.
Thanks
Look at the InfoBox from the utility libraries. There is an example in the documentation.

google maps: use directly on google server?

Usually u have to set up a little script + htmlpage on your server to run google maps,
but i was wondering - is it possible to use google maps directly?
i mean by just calling an url with parameters (gpoint coordinates, zoomfactor ..) and it loads the map fullscreen without having to use my own server?
Sounds like you might be after the static maps api. You can build a URL specifying the properties of the map like:
zoom
position
markers (including custom markers)
image size
etc
and you will get back a rendered image of the map. Something like:
Obviously this just gives you a fixed image of the map you are after. If you need a dynamic Google map, then you will need to use the Google Maps Javascript API.
Not hosted by Google. You might find some other website that uses the API to do the same thing.
Google Maps API