map

Route Map in iPhone

Does iPhone sdk supports route between two places on Map? I have searched many times. But not able to find any reference. Even on apple iphone development forums, there is no such thing available. I have done this functionality using google map url. In which I have to pass source and destination latitude & longitude. I am getting the m...

map over structure with only partial match

I have a tree-like structure of abstract classes and case classes representing an Abstract Syntax Tree of a small language. For the top abstract class i've implemented a method map: abstract class AST { ... def map(f: (AST => AST)): AST = { val b1 = this match { case s: STRUCTURAL => s.smap(f) // structural node for examp...

container of mixed types in C++ (similar to nsdictionary)

What I would like to do (in C++) is create a 'Parameter' data type which has a value, min, and max. I would then like to create a container for these types. E.g. I have the following code: template <typename T> class ParamT { public: ParamT() { } ParamT(T _value):value(_value) { } P...

Google Maps v3 getBounds is extending beyond what is visible on the map

For some reason the getBounds() function for Google Maps v3 seems to be extending much further than what the map is actually showing. Correct me if I'm wrong, but shouldn't it return the NE (top right corner) and SW (bottom left corner) latitude and longitude coordinates for the very corners of what's being shown in the current view? I...

Fastest type for std::map key?

I would like to use the partitions of a graph as the key to a std::map I could represent this as a std vector of nodes. Or I could convert it into a more compact 'custom' binary format (bitset?), or a string representation. For simplicitiy's sake, we can say there is no inherent order to partitions of a graph. Which will be fastest i...

const_reference or iterator for map (when not actually iterating)

I have some code that uses an iterator to loop through all elements of an unordered_map, but within that loop there are several other processes where I store iterators to particular elements in the map, and generally do lots of jumping around but not iterating (excluding the outermost iterator). It seemed to me that it may be more suita...

STL set of map iterators

I have an stl unordered_map and I would like to store references to elements in that map. I would like there to be no duplicate references. I thought I could create an set of iterators which pointed to elements. For one I wasn't sure that it would recognise , but even so I got some long template errors which I think boiled down to the...

Segfault in map

Hello, I can't understand why does this code fail with segfault: #include <cstdlib> #include <iostream> #include <map> #include <string> using namespace std; int main(int argc, char** argv) { map <string, string> temp; map <string, string>::iterator it; S string text = ""; string thatChange = ""; str...

Why does this segfault?

for(ItemTemplateListIterator iter = item_template_list.begin(); iter != item_template_list.end(); ++iter) { int id = iter->first; string description = iter->second->description; some_file_stream << id << endl; some_file_stream << description << endl; } Where item_template_list is a map of <int, MyClass*>, ItemTemplateL...

Casting and Retrieving a Key Set of a Map

I have a method- private void mapSomething(Class<?> dataType){ if(dataType.isInstance(Map.class)){ // How do I get the key set of the map } } Method is called like- mapSomething(someHashMap.getClass()); // Hash Map How do I get the key set of the map inside the method? ...

How to iterate through map, modify map but restore at each iteration?

I have a std::map<int,int> lets call it my_map I iterate through this map using iterators and a for loop. Within each iteration I want to modify many elements in this map but restore it again to its original values for next iteration of the loop. I thought I could create a temporary copy of the iterator my_temp_map , but then I wouldn...

How to open marker info window outside of Google Map

Can anybody help. I have below code and it's working fine but I would like to open info window outside of Google Map. Example: <a href='javascript:void(0)' onclick='infoopen("1")'>Marker 1</a> JavaScript code: var infowindow; var map; var mapDrawn = false; var hotels = []; var markers = []; Site.gmapInit = function(centerX, centerY,...

How to convert a Navigablemap to String[][]

I need to convert a navigable map to a 2d String array.Below given is a code from an answer to one of my previous question. NavigableMap<Integer,String> map = new TreeMap<Integer, String>(); map.put(0, "Kid"); map.put(11, "Teens"); map.put(20, "Twenties"); map.put(30, "Thirties"); map.put(40, "Forties"); map.put(50, "Senior"); ...

How to add valid key without specifying value to a std::map ?

Hi, I have a std::map, and I would like to add a valid key to iterate over it later, but without giving any value (it will be given later on in the course of the iterations). This is how I do it for now : std::vector<std::string> valid_keys; //Fill... Then : std::map<std::string, float> map; for(size_t i = 0 ; i < valid_keys.size() ;...

jQuery maphilight change color of fly

I'm using this plugin http://davidlynch.org/js/maphilight/docs/ But can't figure out, how to change color on fly. It uses metadata plugin, and does it via class directive, but changes don't apply on fly. e.g. class="{stroke:false,fillColor:'000000',fillOpacity:1,alwaysOn:true}" and now I want to change color: class="{stroke:false,f...

Weird linker error with static std::map

Why do I get linker error when I try to compile this in Visual Studio 2008 #include <stdafx.h> #include <iostream> #include <map> #include <string> class MyClass { public: MyClass () { }; virtual ~MyClass() {}; static std::string niceString (std::map<int, int> mappp) { _myMap = mappp; return "nice string"; }; private: static std:...

How do I map (and sort) values from a hash of hashes?

I have a hash of hashes, like so: %hash = ( a => { b => 1, c =>2, d => 3}, a1 => { b => 11, c =>12, d => 13}, a2 => { b => 21, c =>22, d => 23} ) I want to extract the "b" element and put it into an array. Right now, I am looping through the hash to do this, but I think I can improve efficiency slightly by using...

Convert GPS coordinates to coordinate plane

This is somewhat related to another question I asked: Translate GPS coordinates to location on PDF Map. That got me to this point, now I'm stuck on the math. Let's say I have a floor plan of a building, I've taken gps coordinate readings from each corner of the building. Also assume that the floor plan is lined up with the latitude an...

Map Visualizations

We are looking for a great looking map visualization to plot transaction as we process them. We get inbound messages from all over the united states (latitude, longitude). We currently have a Google Maps solution in place, but it just doesn't have the visual impact we are looking for. We really like how this map looks: http://leftronic....

Switching from activity to MapActivity

Button showmapButton = (Button)findViewById(R.id.showmap); showmapButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(HomePage.this, ShowMap.class); intent.putExtra("username", value); startActivity(intent); } }); In my main menu i have...