Implementing googlemaps in asp.net - javascript

I need to solution for this.
I have a textbox(id="location") in which a city is entered, which need to be shown on the map, then the user should be able to place markers on the location of his wish(specific place within the entered city) and that location(Longitude and Latitude) should be shown in a label(id="showselected").
Is there any easy way to accomplish this, I don't want to learn the google API. Its for my school project.
Thanks

Related

Create own markers in Google maps Api Javascript

newcomer here, been searching through google but not finding the help i need.
Im making a website for outdoor gyms, where I have placed my markers with coords(may have to stash them in mysql) but currently in my code in a markers array.
I want the user to be able to input their adress/county to find the closest outdoor gym/ running track based on their preference. The search should search through the markers and find the closest one in that area.
Until now, i have the map, the markers, the searchfunction is a big obstacle for me atm.
I appreciate any kind of help.
you could save markers by their coordinates (longitude and latitude) on your db. Then, you could use leaflet to load googleMap or openstreet map and draw your markers.
This is an useful tutorial https://scotch.io/tutorials/making-mean-apps-with-google-maps-part-i. I think it is the good point to start.

Google Maps prevent Streetview using Custom Panaromas Javascript API v3

I'm using the street-view platform to build a first person game. My problem is that sometimes if you're in a popular location google has 'custom panoramas' that are embedded in streetview, that you end up being put in. With the ability to look around but not move (you have to use a different map view to get out) and this isn't a desired effect.
Has anyone come across a way of prevent custom panoramas?
Google / Stackoverflow don't seem to have any answers unfortunately!
All help greatly appreciated .
I ended up resolving this by changing the way I was thinking about the problem.
The custom panaromas don't share the same lat/lon as the underlying StreetView data.
So if a user was searching for 'location a' and it had a custom Panaroma at the returned lat/lon the user was dropped into the panaroma. To ensure the user was Kept in a StreetView I grabbed the location A Lat/lon and used the RoadsAPI to find the nearest road - which then has correct StreetView data to use.

How do you create custom interactive areas on Google Maps?

I'm trying to create a map that shows county/district areas using Google Maps that will allow users to click on the area to retrieve relevant pop up information.
I have two datasets that I think would help, one being a list of UK Postcodes which would in turn allow me to determine different postal areas and the other is a dataset from Ordance Survey that contains province borders (county/district borders).
I've looked into KML Files and ImageMap but I'm not sure how to create these areas using the data I have?
I'm looking to achieve the sort of map that is used here:
http://content.met.police.uk/Page/YourBorough
Any help is greatly appreciated!
Thanks.
The way to work with Google maps is by using their api closely. You cannot go with simple image mapping.
Try those two links for starters:
https://developers.google.com/maps/documentation/javascript/examples/polygon-simple
and
https://developers.google.com/maps/documentation/javascript/reference#Polygon.
In short - you may need to draw a polygon for every area, bind a click event to it, then show Info Window with the relevant information for the user.
In case you're new to google maps, you may need to take more time inspecting their Api and the examples they give.
Best regards.

Any Javascript API for maps with country-specific display?

Is there any Javascript API that does not display the entire world map and later allows to zoom and click to individual countries, but instead just displays the country we are interested and allows region-level clicks? In other words, I am looking for an API similar to JVectorMap but this does not have comprehensive support for all countries and it does not show street-level view when zooming further deep into state/city level. I hope my requirements are clear. If I am interested only in let's say England's map, I want the map to show just England but allow state and city-level clicks with street-level or near street-level views at the lowest level as an optional feature (not too many details at the lowest-level). Google Maps, jHERE etc. seem to show the entire world map and allow to zoom-in, which is not something I want.
thanks,
Paddy
If you only want the street maps for one country to be visible, you could download the Open Street Map data into a PostGIS database for that country and that country only, and generate tiles. There are several tutorials on how to download data and make tiles, e.g. http://switch2osm.org/serving-tiles/manually-building-a-tile-server/

Google Maps API V3 zoom in/out with a button outside the map itself

I'm working on a company website of an acquaintance of mine. The company has 7 offices spread all over the country. He has asked me to create a page listing these offices (with contact info, picture, etc.), and add a Google map to it with multiple markers that indicate the offices.
I've done so, but seeing as the zoom-level (a complete country) isn't really detailed, I was thinking about making the map zoom in to specific markers/offices when clicking on the office in the aforementioned list.
I however have no idea if there's a way to perform actions inside the map, from outside the map. Does anybody know?
The website is not live yet, but as an example, you can take a look at this link: http://www.inter-psy.nl/contact/contactgegevens
What I'd like to do is (for example) make the colored block/header perform a map zoom-in to a specific marker when clicking on it.
You must make the map-variable globally accessible, then you may perform any action on the map from anywhere in the page(e.g. map.setCenter() to center the map at a specific location or map.setZoom() to set the zoom-level)
To make the variable globally accessible remove the var-keyword when creating the map

Categories

Resources