maps

three.js emissive material maps

旧巷老猫 提交于 2019-12-04 10:29:21
I'm currently experimenting a bit in three.js, and I'd like to use an emissive map. I've tried just loading a texture into the emissive property of a phong material, but it doesn't work like that, unfortunately. Here's my code: var params = { emissive: THREE.ImageUtils.loadTexture( emissive ), shininess: shininess, map: THREE.ImageUtils.loadTexture( map ), normalMap: THREE.ImageUtils.loadTexture( normalMap ), normalScale: new THREE.Vector2(0,-1), envMap: this.reflectionCube, combine: THREE.MixOperation, reflectivity: 0.05 }; var material = new THREE.MeshPhongMaterial(params); Can anyone point

error:InvalidValueError: setCenter: not a LatLng or LatLngLiteral: in property lat: not a number

若如初见. 提交于 2019-12-04 10:05:34
问题 function initAutocomplete() { var lat=document.getElementById('lat').value; var lng=document.getElementById('lng').value; console.log(lat); console.log(lng); var map = new google.maps.Map(document.getElementById('map'), { center: {lat:lat, lng:lng}, zoom: 13, mapTypeId: 'roadmap' });} it gives me the following error : error:InvalidValueError: setCenter: not a LatLng or LatLngLiteral: in property lat: not a number 回答1: The .value attribute of a HTMLInputElement returns the value as a string.

Plot geocode: ggmap error

耗尽温柔 提交于 2019-12-04 09:38:15
I want to visualize a dataframe with R and the ggmap package. df: | lon | lat | |-----------|-----------| | 6.585863 | 51.09021 | | 8.682.127 | 50.11092 | | 7.460.367 | 5.152.755 | I created a map with mapImageData <- get_googlemap( + "Germany", + zoom=15 + ) And then wanted to add the geocodes: ggmap(mapImageData) + + geom_point(aes(x=lon, y=lat), data=df, colour="red", size=5) But I get the error: Error: geom_point requires the following missing aesthetics: x, y What am I doing wrong? You have three problems: More than one deicmal point in some values & decimal points probably not at the

How do you create a 50 state map (instead of just lower-48)

眉间皱痕 提交于 2019-12-04 09:18:11
问题 How do you make a 50 state map in R? It seems like all the example maps people have created are just of the lower 48 回答1: There are lots of ways that you can do this. Personally, I find Google to have the most attractive maps. I recommend ggmap , googleVis , and/or RgoogleMaps . For example: require(googleVis) G4 <- gvisGeoChart(CityPopularity, locationvar='City', colorvar='Popularity', options=list(region='US', height=350, displayMode='markers', colorAxis="{values:[200,400,600,800], colors:[

How can I change the location center of a map using Leaflet API?

孤者浪人 提交于 2019-12-04 08:46:08
问题 My map (Mapbox) takes up the whole background of the site so the center is in the middle of the site. But the focus of the map for the user is on the right side because I have content overlapping the map on the left side. When leaflet grabs the location, it's from the center of the map, but it would be more convenient if I could set it to grab the location from the center of the right third of the site, so that way the user won't be centering the map on targets bordering content on the left

Format the ggplot2 map

て烟熏妆下的殇ゞ 提交于 2019-12-04 07:35:09
I´m trying to produce a worldmap using ggplot2 in R. I want to show GDP per capita from Brazilian States. There are 2 problems: In the center of Country have two labels aren't easy to read the information. They are overlapping.Reducing the numbers not resolved. I would like to change the colour breaks and don't know how to access it. I would like to use colors to become easy to note the diferences of GDP. My data is: https://docs.google.com/file/d/0B_coFit6AovfcEFkbHBjZEJaQ1E/edit Here is my code: library(maptools) gpclibPermit() library(ggplot2) library(rgdal) library(rgeos) library(ggmap) #

How to overlay a circle on an iOS map

拈花ヽ惹草 提交于 2019-12-04 07:32:18
I've got a radius and a location. This is how I'm trying to get the bounding rectangle of the circle. - (MKMapRect)boundingMapRect{ CLLocationCoordinate2D tmp; MKCoordinateSpan radiusSpan = MKCoordinateRegionMakeWithDistance(self.coordinate, 0, self.radius).span; tmp.latitude = self.coordinate.latitude - radiusSpan.longitudeDelta; tmp.longitude = self.coordinate.longitude - radiusSpanSpan.longitudeDelta; MKMapPoint upperLeft = MKMapPointForCoordinate(tmp); MKMapRect bounds = MKMapRectMake(upperLeft.x, upperLeft.y, self.radius * 2, self.radius * 2); return bounds; } MKMapRectMake(...) seems to

What is the best way to read, represent and render map data?

自作多情 提交于 2019-12-04 07:29:11
问题 I am interested in writing a simplistic navigation application as a pet project. After searching around for free map-data I have settled on the US Census Bureau TIGER 2007 Line/Shapefile map data. The data is split up into zip files for individual counties and I've downloaded a single counties map-data for my area. What would be the best way to read in this map-data into a useable format? How should I: Read in these files Parse them - Regular expression or some library that can already parse

Plotting netcdf in R with correct grid

懵懂的女人 提交于 2019-12-04 06:26:19
问题 My goal is to plot nitrate (no3) data on a world map, using the correct longitude and latitude for these data. There are two netcdf files: 1. with the data 2. with the grid information Summary info on the data: no3 is an array of length x*y*sigma no3_df is 'x*y obs. of 3 variables' x = integer [180] y = integer [193] sigma = array[53] I want to look at sigma ('depth') 20. I therefore did the following: # Load the needed libraries to handle netcdf files library(ncdf) library(akima) # Open data

Center maps in iOS Programming

◇◆丶佛笑我妖孽 提交于 2019-12-04 06:16:21
How do we follow the user in maps. I want to have the blue dot (user location) be in the center of the map, But I also what to allow the user to zoom in and zoom out and then after a couple seconds zoom in back in the user location. My Educated Guess for the Solution: We detect if the user is zooming in or out, after three seconds of no zooming in or out detection, we starting follow the user :). Your HELP would be awesome :) This code zoom in the user location but doesn't delay for zoom in and out: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *